Dynamic Web Page Development - h-1
Dynamic Web Page Development - h-1
Subject Code:3350702
Practical List
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>
<br></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>
</body>
</html>
<html >
<head>
<style>
li{
display : inline-block ;
background-color : white;
a{ color :
black; }
.menu { border-radius: 90px 40px
90px 40px ;
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>
OUTPUT:-
<html >
<head>
<style>
li{
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>
<div class="google">
<img
src="https://www.google.com/images/branding/googlelogo/1x/googlelogo_color_272x92dp.p
ng" alt="Google"/></a>
</div> <center><input type="search" size="50%" placeholder="search Here" > <button
class="btn">search</button></center>
<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 ;
background-color : white;
}
a{ color :
black;
.menu {
img {
background: lightyellow;
@keyframes eleft {
0%{left :0px;}
/*.p{
text-align: center;
list 5s infinite;
@keyframes list{
0%{top: 0px; }
40%{top: 30px;}
70%{top : 80px;}
80%{top : 90px; }
}*/
#scroll{
border:3px solid red;
border-radius: 5px;
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 {
translateY(-100%);
to {
-moz-transform: translateY(100%);
-webkit-transform: translateY(100%);
transform: translateY(100%);
}
</style>
</head>
<body bgcolor="skyblue">
<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>
9. Write a PHP script to display Welcome message.
<?php echo "<p align ='center' size=>Welcome
</p>";
?>
• Write a PHP script to demonstrate use of arithmetic operators, comparison operators, and
logical operators.
<?php
$x=16;
$y=12;
$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";
?>
$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;
?>
12. Write PHP Script to print Fibonacci series
<?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;
<?php
$x=array
(
array (12,23),
array (12,43)
);
$y=array
(
array (13,33),
array (42,23)
);
}
echo"<br>";
}
}
echo"<br>";
}
}
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>');
}
?>
14. Write PHP script Using user defined function
<?php
echo ord("vinay");
echo "<br>";
echo strtolower("Panchal");
echo "<br>"; echo strlen("Panchal Hardik")."<Br>";
echo "<br>";
echo "<Br>";
?>
15. Write PHP script to demonstrate use of date/time functions and Math functions.
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="Hardik";
$lname="Panchal";
?>
<a href="url2.php?First_name=<?php echo $fname; ?>&last_name=<?php echo $lname; ?>">
Click here to Pass Variable through URL
</a>
Script For ulrtwo.Php File<br>
<?php
echo "First Name : ".$_GET['First_name']."<br>";
echo "Last Name : ".$_GET['last_name'];
?>
• Write two different PHP script to demonstrate passing variables through Hidden Variables.
<html>
<head>
<title>Hidden Variables</title>
</head>
<body align="center">
<form method="post" action="hiddentwo.php">
<input type="hidden" name="fname" value="Hardik">
<input type="hidden" name="lname" value="Panchal">
<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();
<?phpsetcookie("cname","Hardik Panchal");
setcookie("Email","[email protected]"); setcookie("age",
"18");
?>
<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 />";
echo "Your age is : <u>".$_COOKIE["age"] . "</u><br />";
}
else
echo "cookies not setted";
?>
</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>