Dynamic Web Page Development
Dynamic Web Page Development
Dynamic Web Page Development
Subject Code:3350702
Practical List
Name : jay prajapati
enrollment no . 196450307117
1. Write HTML codes for displaying image and demonstrate hyper linking.
<html>
<head>
<body>
<br>
</body>
</head>
</html>
2. Write HTML codes to attach video on webpage using embed tag in html.
<html>
<body>
<title>assithree</title>
<h1 align="center">Video Attach on Webpage</h1>
<hr>
<html>
<hr>
<form>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<input type="submit" value="Submit">
<hr>
<form><br>
<input type="submit">
</from>
</body>
</html>
5. Write a code for creating static page design using division tag
<html>
<body >
<hr>
<br>
What Does Java Mean? Java is an object-oriented programming language that produces software
for multiple platforms. When a programmer writes a Java application, the compiled code (known as
bytecode) runs on most operating systems (OS), including Windows, Linux and Mac
OS.∀</div></font> </p>
<hr>
<br>
<p>
</p>
</body>
</html>
<html >
<head>
<style>
li{
display : inline-block ;
background-color : white;
a{
color : black;
}
.menu {
padding : 6px;
font-size : 120%;
</style>
</head>
<body>
<li><a href="#">about</a></li>
<li><a href="#">contact</a></li>
<li><a href="#">about</a></li>
</ul>
</div>
</body>
</html>
7. Design Google Page using HTML5.
<html >
<head>
<style>
li{
display : inline-block ;
border-radius:19px 16px 16px 16px;
background-color : #00FFFF ;
}
a{
padding : 7px;
color : black;
}
.menu {
background : ;
font-family : Century Schoolbook ;
font-size : 140%;
}
img
{
display: block;
margin-top: 11%;
margin-bottom: auto;
margin-left: auto;
margin-right: auto;
</style> </head>
<br>
8. Apply CSS formatting to created pages and explore it fully, also use readymade css templates.
<html>
<head>
<style type="text/css">
li{
display : inline-block ;
box-shadow :10px 10px 50px lightyellow;
width: 130px;
height: 30px;
text-align: center;
background-color : white;
a{
color : black;
.menu {
padding : 6px;
font-size : 150%;
img {
width: 1320px ;
height: 400px ;
background: lightyellow;
@keyframes eleft {
0%{left :0px;}
30%{right: 500px;background: grey;border-radius:60px 40px 90px 40px;}
/*.p{
text-align: center;
position: relative;
@keyframes list{
0%{top: 0px; }
40%{top: 30px;}
70%{top : 80px;}
80%{top : 90px; }
}*/
#scroll{
border-radius: 5px;
height: 300px;
overflow: hidden;
background: grey;
#scrool-a{
height: 100%;
text-align: center;
-moz-transform: translateY(-100%);
/* -webkit-transform: translateY(-100%);*/
transform: translateY(-900%);
/*@-webkit-keyframes my-animation {
to { -webkit-transform: translateY(100%); }
}*/
@keyframes my-animation {
from {
-moz-transform: translateY(-100%);
/*-webkit-transform: translateY(-100%);*/
transform: translateY(-100%);
}
to {
-moz-transform: translateY(100%);
-webkit-transform: translateY(100%);
transform: translateY(100%);
</style>
</head>
<body bgcolor="skyblue">
font-size:150%;
border-width:5px;
background: lightyellow;
height:50px;font-size:40px ;
<br>
<br>
<li><a href="#">about</a></li>
<li><a href="#">contact</a></li>
<li><a href="#">about</a></li>
</ul>
</div>
<br>
<br>
computer
<br>
chemical
<br>
mechanical
<br>
petro chemical
<br>
electrical
<br>
information technology</div></div>
</div>
</body>
?>
• Write a PHP script to demonstrate use of arithmetic operators, comparison operators, and
logical operators.
<?php
$x=16;
$y=12;
echo "<Br>";
echo "<Br>";
echo "<Br>";
echo "Comparison Operator :";
echo "<Br>";
$z="16";
if( $x===$z)
echo "true";
else
echo "false";
echo "<Br>";
$a=2;
$b=6;
echo "<Br>";
echo "<Br>";
echo "Logical operators :";
echo "<Br>";
echo "<Br>";
if($a==21 xor $b==6)
echo "true";
else
echo "false";
echo "<Br>";
if($a!=2)
echo "true";
else
echo "false";
?>
10. Write a PHP script to get type of variable using gettype().
Write a PHP script to set type of variable using settype()
<?php
$a=10;
$b="xyz";
echo "three is simple gettype fuction output here: "."<br>";
echo gettype("datatype of a is :".$a)."<br>";
echo gettype("datatype of b is :".$b)."<br>";
echo "after a change datatype of variable a by useing settype fuction output is here :
"."<br>";
echo settype($a,"string");
echo gettype("datatype of a is :".$a)."<br>";
echo "after a change datatype of variable b by useing settype fuction output is here : "."<br>";
echo settype($b,"float");
echo gettype("datatype of b is :".$b)."<br>";
?>
11. Write a PHP script to set type of variable using type casting.
<?php
$a=12.45;
$b=(int)$a;
?>
<?php
$sum1=0;
$sum2=1;
$number=15;
?>
• Write PHP Script to calculate total marks of sudent and display grade.
<?php
$a=90;
$b=80;
$c=89;
$d=98;
$tot=$a+$b+$c+$d;
echo "<h1>total marks of four subjects marks :<br>".$tot."</h1>" ;
if($tot>350)
{
echo"<h2>A greade</h2>";
}
else if($tot>250)
{
echo"<h2>B greade</h2>";
}
else if($tot>150)
{
echo "<h2>C greade</h2>";
}
else{
echo "<h2>D greade</h2>";
}
?>
• Write PHP Script to find maximum number out of three given numbers.
<?php
$a=10;
$b=90;
$c=60;
13. Write PHP Script using two dimensional arrays such as addition of two 2x2 matrices.
<?php
$x=array
(
array (12,23),
array (12,43)
);
$y=array
(
array (13,33),
array (42,23)
);
}
echo"<br>";
}
}
echo"<br>";
}
for($i=0;$i<2;$i++)
{
for($j=0;$j<2;$j++)
{
$c[$i][$j]=$x[$i][$j]+$y[$i][$j];
}
echo"<br>";
}
?>
• Write PHP Script to demonstrate use of associative arrays and for FOR EACH loop execution.
<?php
$name=array('1'=>'JAVA',
'2'=>'DWPD',
'3'=>'CNS',
'4'=>'CMTS');
foreach($name as $values){
echo($values.'<br>');
}
?>
<?php
echo "<h1>set case sensitive :</h1> ";
define("a","bharuch",false);
echo "<br>";
echo "<br>";
echo "shree k j polytechnic ". a;
echo "<br>";
echo"shree k j polytechnic " . A;
echo "<br>";
echo "<br>";
echo ord("vinay");
echo "<br>";
echo strtoupper("jay"); echo "<Br>";
echo strtolower("prajapati");
echo "<br>"; echo strlen("prajapati jay")."<Br>";
echo "<br>";
echo "<Br>";
?>
15. Write PHP script to demonstrate use of date/time functions and Math functions.
<?php
echo date("d/m/y");
echo "<br>";
echo date("D/M/Y");
echo "<br>";
echo date("l-F-y");
echo "<br>";
echo date("d/m/y h :i :s a");
echo "<br>";
echo date("d/m/y h :i :s A");
echo "<br>";
echo date("d/m/y G :i :s A");
echo "<br>";
print_r(getdate());
echo "<br>";
if (checkdate(13, 33, 2011)) {
echo "Date is valid date<br/>";
}
else
{
echo "Date is not valid date<br/>";
}
echo"<br>";
echo time();
echo "<br>";
echo mktime(1,1,1,1,1,2001);
?>
16. Create form using text box, check box, radio button, select, submit button. And display user
inserted value in new PHP page (e.g. student registration/inventory/library form).
<html>
<head>
<title>Login page </title>
</head>
<body>
<form action="loginpostphp.php" method="POST" >
Email : <input type="email" name="name1" size="40" required /><br>
<br>
<?php
$fname="jay";
$lname="prajapati";
?>
<a href="ulrtwo.php?First_name=<?php echo $fname; ?>&last_name=<?php echo $lname; ?>">
Click here to Pass Variable through URL
</a>
<html>
<head>
<title>Hidden Variables</title>
</head>
<body align="center">
<form method="post" action="hiddentwo.php">
<input type="hidden" name="fname" value="Jay">
<input type="hidden" name="lname" value="Prajapati">
<h1>click here and see your passing variables through Hidden Variables demo : </h1><br><input
type="submit" name="submit" value="submit">
</form>
</body>
</html>
?>
18. Write two different PHP script to demonstrate passing variables with sessions
<html>
<head>
<title>Session Demo</title>
</head>
<form method="post" action="srssiontwo.php">
Enter Your name : <input type="text" name="fname">
Enrollment number : <input type="text" name="ename1">
Email : <input type="email" name="ename2">
<input type="submit" name="submit" value="Create session">
</form>
</html>
<?php
session_start();
if(isset($_POST['submit']))
{
$sr=$_POST['fname'];
$br=$_POST['ename1'];
$er=$_POST['ename2'];
$_SESSION['sr']=$sr;
$_SESSION['br']=$br;
$_SESSION['er']=$er;
//session_start();
?>
<html>
<head>
<title>Set Cookies with PHP</title>
</head>
<body>
</html>
<html>
<head>
<title>Accessing Cookies with PHP</title>
</head>
<body>
<?php
if(isset($_COOKIE["cname"]) && isset($_COOKIE["age"]) && isset($_COOKIE["Email"])) {
echo "Welcome : <b>".$_COOKIE["cname"]. "</b><br />";
echo "Your email i'd is : <u>".$_COOKIE["Email"]. "</u><br />";
</body>
</html>
• Write a program to keep track of how many times a visitor has loaded the page.
<?php
if(!$handle)
{
}
else
{
$counter = (int ) fread($handle,20);
fclose ($handle);
$counter++;
echo" <strong> you are visitor no ". $counter . " </strong> " ;
$handle = fopen("counter.txt", "w" );
fwrite($handle,$counter);
fclose($handle);
}
?>
19. Write a PHP script to connect MYSQL server from your web application.
<?php
$con = mysqli_connect("localhost","root","") ;
$db = mysqli_select_db ($con,"kjdatabasework") ;
$cmd = mysqli_query($con,"create table Test (ID integer, Name
varchar (20))") ;
if ($con)
{
echo "Connected with MySQL <br>" ;
}
else
{
echo "Can not connect with MySQL <br>" ;
}
if ($db)
{
echo "Database Selected Successfully <br>";
}
else
{
echo "Error while selecting the Database <br> " ;
}
?>
20. Write a PHP script to create and drop database.
<?php
$con=mysqli_connect('localhost','root','')or die("dd");
if($con)
{
echo "MYSQL server connected<br><br>";
}
$sql="CREATE DATABASE SrDB";
if($query=mysqli_query($con,$sql))
{
echo "Database created <br><br>";
}
<?php
$con=mysqli_connect('localhost','root','');
mysqli_select_db($con,"kalash");
while($raw=mysqli_fetch_assoc($query))
{
?>
<tr>
<td><?php echo $raw['f_id'] ?></td>
<td><?php echo $raw['user_name'] ?></td>
<td><?php echo $raw['user_email'] ?></td>
<td><?php echo $raw['f_des'] ?></td>
<td><?php echo $raw['user_id'] ?></td>
</tr>
<?php
}
?>
</table>