Practical 1: HTML Codes For Displaying Image and Demonstrate Hyper-Linking Code
Practical 1: HTML Codes For Displaying Image and Demonstrate Hyper-Linking Code
Practical 1
<html>
<head>
<title>Untitled Document</title>
</head>
<body>
</body>
</html>
Output
PIET-DS Page 1
DWPD (3350702) 156380307529
Practical 2
Aim: - Write html code to attach video on webpage using embed in html
<html>
<head>
</head>
<body>
<embed src="C:\Users\Public\Videos\Sample
Videos\Wildlife.wmv"height="450"width="250"/>
</body>
</html>
Output
PIET-DS Page 2
DWPD (3350702) 156380307529
Practical 3
<html>
<head>
<title>Feedback Form</title>
</head>
<body>
</div>
</div>
</div>
</div>
PIET-DS Page 3
DWPD (3350702) 156380307529
</div>
<option>Personal interest</option>
</select>
</div>
<option>Good</option>
<option>Fair</option>
<option>Poor</option>
<option>Very poor</option>
</select>
</div>
<option>Good</option>
<option>Fair</option>
<option>Poor</option>
<option>Very poor</option>
</select>
</div>
PIET-DS Page 4
DWPD (3350702) 156380307529
<option>Good</option>
<option>Fair</option>
<option>Poor</option>
<option>Very poor</option>
</select>
</div>
<option>Good</option>
<option>Fair</option>
<option>Poor</option>
<option>Very poor</option>
</select>
</div>
<option>No</option>
<option>Not sure</option>
</select>
</div>
</form>
</body>
PIET-DS Page 5
DWPD (3350702) 156380307529
</html>
Output:-
PIET-DS Page 6
DWPD (3350702) 156380307529
Practical 4
<html>
<head>
<title>Untitled Document</title>
</head>
<div align="left">
<form action="#">
<table>
<tr>
<td>Name:</td>
<td>
&nbs
p; &n
bsp; <b>Contact Information</b></td>
</tr>
<tr>
<td>Email: </td>
<td>
&nbs
p; &n
bsp; Telephone: +475637458 </td>
PIET-DS Page 7
DWPD (3350702) 156380307529
</tr>
<tr>
<td>Subject:</td>
<td>
&nbs
p; &n
bsp; Email: [email protected] </td>
</tr>
<tr>
<td>Message:</td>
<td>
&nbs
p; &n
bsp; Address: metro road,vadodara. </td>
</tr>
<tr>
<td>
</td>
</tr>
</table><br />
</form>
</div>
PIET-DS Page 8
DWPD (3350702) 156380307529
</body>
</html>
Output:-
PIET-DS Page 9
DWPD (3350702) 156380307529
Practical-5
Aim:- Create static Parul University Webpage design using division tag
<html>
<head>
<title>parul university</title>
</head>
<div>
<h1> <br/><br/><br/><br/><br/><br/><br/><br/><br/><br/><center><a
href="login1.html"><b>Login</b></a><br />
<a href="student.html"><b>Feedfack</b></a></center>
</h1></div>
</body>
</html>
PIET-DS Page 10
DWPD (3350702) 156380307529
Output:-
<html>
<head>
<title>parul university</title>
</head>
<form action="loginpage.html">
<center>
<tr>
<td><b>Email:</b></td>
</tr>
PIET-DS Page 11
DWPD (3350702) 156380307529
<tr>
<td><b>Password:</b></td>
</tr>
<tr>
<td>
</td>
<td>
</td>
</tr>
</table>
              
 
</form>
</body>
</html>
PIET-DS Page 12
DWPD (3350702) 156380307529
Output:-
<html>
<head>
</head>
<body background="capture.jpg">
<h1><center>Login Successful</center></h1>
<p><h2><center>Welcome..! </br>
</body>
</html>
PIET-DS Page 13
DWPD (3350702) 156380307529
Output:-
<html>
<head>
<title> forgot</title>
</head>
<body>
<form action="regi.html">
<center><table>
<tr>
<td>E-Mail ID:</td>
PIET-DS Page 14
DWPD (3350702) 156380307529
</tr>
<tr>
</tr>
</table></center>
</form>
</body>
</html>
Output:-
PIET-DS Page 15
DWPD (3350702) 156380307529
PIET-DS Page 16
DWPD (3350702) 156380307529
PIET-DS Page 17
DWPD (3350702) 156380307529
Practical:-6
Aim:-Write a code for design menu system of Notepad using list tag
Code:-
<html>
<head>
</head>
<body>
<font size="32">
<ol style="1">
<li><a href="edit.html">Edit</a></li>
<li><a href="format.html">Format</a></li>
<li><a href="view.html">View</a></li>
<li><a href="help.html">Help</a></li>
<ol></font>
</body>
</html>
PIET-DS Page 18
DWPD (3350702) 156380307529
Output:-
Code:-
<html>
<head>
</head>
<body>
<ul style="*">
PIET-DS Page 19
DWPD (3350702) 156380307529
</ul>
</body>
</html>
Output:-
Code:-
<html>
<head>
</head>
<body>
<ul style="*">
PIET-DS Page 20
DWPD (3350702) 156380307529
</ul>
</body>
</html>
Output:-
Code:-
<html>
<head>
</head>
PIET-DS Page 21
DWPD (3350702) 156380307529
<body>
<ul style="*">
</ul>
</body>
</html>
Output:-
Code:-
<html>
<head>
</head>
<body>
PIET-DS Page 22
DWPD (3350702) 156380307529
<ul style="*">
</ul>
</body>
</html>
Output:-
Code:-
<html>
<head>
</head>
<body>
<ul style="*">
</ul>
</body>
</html>
Output:-
Practical 7
PIET-DS Page 24
DWPD (3350702) 156380307529
<head>
<title>Google</title>
</head>
<body>
<a href="#">Images</a>
</div>
<center>
<br/>
<br/>
<a href="#">Gujrati</a>
<a href="#">Hindi</a>
<a href="#">Marathi</a>
<a href="#">Tamil</a>
<a href="#">Telugu</a>
</center>
</body>
</html>
OUTPUT
PIET-DS Page 25
DWPD (3350702) 156380307529
PIET-DS Page 26
DWPD (3350702) 156380307529
Practical 8
Aim: - Apply CSS formatting to created pages & use readymade CSS
template
<html>
<head>
<title>CSS Template</title>
<meta charset="utf-8">
<style>
box-sizing: border-box;
body
margin: 0;
.topnav
overflow: hidden;
background-color: #333;
.topnav a
float: left;
PIET-DS Page 27
DWPD (3350702) 156380307529
display: block;
color: #f2f2f2;
text-align: center;
text-decoration: none;
.topnav a:hover
background-color: #ddd;
color: black;
.content
background-color: #ddd;
padding: 10px;
height: 200px;
.footer
background-color: #f1f1f1;
padding: 10px;
</style>
</head>
<body>
<div class="topnav">
PIET-DS Page 28
DWPD (3350702) 156380307529
<a href="#">Link</a>
<a href="#">Link</a>
<a href="#">Link</a>
</div>
<div class="content">
<h2>CSS Template</h2>
</div>
<div class="footer">
<p>Footer</p>
</div>
</body>
</html>
Output:
PIET-DS Page 29
DWPD (3350702) 156380307529
Practical 9
Aim:- Write a php script to print welcome message and also make
calculator using operators
<?php
echo "<h1><b>Welcome</b></h1>";
$a=16;
$b=8;
$cal="add";
switch($cal)
case "add":
$c=$a+$b;
break;
case "sub":
$c=$a-$b;
break;
case "mul":
$c=$a*$b;
break;
case "div":
$c=$a/$b;
break;
PIET-DS Page 30
DWPD (3350702) 156380307529
default:
echo "exit";
break;
$x=5;
$y=5.0;
echo"<br/>";
echo"<br/>";
if($x===$y)
else
echo"<br/>";
if($x==$y)
else
PIET-DS Page 31
DWPD (3350702) 156380307529
$a = 42;
$b = 0;
if( $a && $b )
else
if( $a and $b )
else
if( $a || $b )
PIET-DS Page 32
DWPD (3350702) 156380307529
else
if( $a or $b )
else
$a = 10;
$b = 20;
if( $a )
else
if( $b )
PIET-DS Page 33
DWPD (3350702) 156380307529
else
if( !$a )
else
if( !$b )
else
?>
Output
PIET-DS Page 34
DWPD (3350702) 156380307529
PIET-DS Page 35
DWPD (3350702) 156380307529
Practical 10
Aim: - Write a php script to get type of variable using gettype()
and settype()
<? php
$i=1;
echo gettype($i);
settype($i,"string");
echo "<br/>";
echo gettype($i);
?>
Output
PIET-DS Page 36
DWPD (3350702) 156380307529
Practical 11
Aim: - Write a php script to set type of variable using type casting
<?php
$x = "Hello world!";
$y = 'Hello world!';
echo $x;
echo "<br>";
echo $y;
?>
Output
PIET-DS Page 37
DWPD (3350702) 156380307529
Practical 12
Aim : - Write php script to generate result and display grade
<?php
$a=50;
switch($a)
case $a>=90:
break;
case $a>=80:
break;
case $a>=70:
break;
case $a>=50:
break;
default:
break;
PIET-DS Page 38
DWPD (3350702) 156380307529
?>
Output
PIET-DS Page 39
DWPD (3350702) 156380307529
Practical 13
Aim: - Write php script for Fibonacci series and maximum out of three
numbers
<?php
$num = 0;
$n1 = 0;
$n2 = 1;
echo "\n";
$n1 = $n2;
$n2 = $n3;
$num = $num + 1;
?>
Output
PIET-DS Page 40
DWPD (3350702) 156380307529
$a=20;
$b=10;
$c=1;
else
?>
Output
PIET-DS Page 41
DWPD (3350702) 156380307529
Practical 14
Aim: - Write php script to add 2*2 matrices
<?php
$a1 = Array('0' => Array('0' => 1,'1' => 2),'1' => Array('0' => 4,'1' => 5));
$a2 = Array('0' => Array('0' => 1,'1' => 2),'1' => Array('0' => 4,'1' => 5));
$sumArray = array();
$result = array();
echo "<pre/>";print_r($result);
?>
Output
PIET-DS Page 42
DWPD (3350702) 156380307529
PIET-DS Page 43