Program 1
<?php include 'FrontPage.php'?>
<html>
<body>
<br><br><br><br><br><br><br><br><br><br>
<center>
<form method=post action="StudentUpdate.php">
<table border=1>
<tr>
<th>Student Id For Update</th>
<td><input type=text name=txtid></td>
</tr>
<tr>
<td></td>
<td><input type=submit value=Search name=btnSubmit></td>
</tr>
</table>
</form>
<pre>
<?php
if(isset($_POST['btnSubmit']))
{
$stid=$_POST['txtid'];
$mycon=mysqli_connect("localhost","root","","Library") or die("Connection not success");
$sql="select * from studentdata where sid=".$stid;
$record=$mycon->query($sql);
if(mysqli_num_rows($record)>0)
{
session_start();
$_SESSION['studid']=$stid;
?>
<table border=1>
<tr>
<th>Roll No</th><th>Name</th><th>Phy</th><th>Chem</th><th>Maths</th>
</tr>
<tr>
<?php
echo "<form method=post action=UpdateData.php>";
while($row=mysqli_fetch_assoc($record))
{
echo "<td>". $row['sid']."</td>";
echo "<td><input type=text name=txtname value=".$row['sname']."></td>";
echo "<td><input type=text name=txtphy value=".$row['phy']."></td>";
echo "<td><input type=text name=txtchem value=".$row['chem']."></td>";
echo "<td><input type=text name=txtmath value=".$row['math']."></td>";
echo "<td><input type=submit value=Update></td>";
}
echo "</form>";
}
else
echo "<font color=red size=5>Record not found</font>";
}
?>
</tr>
</pre>
</center>
</body>
</html
Program 2
<?php include 'FrontPage.php'?>
<html>
<body>
<br><br><br><br><br><br><br><br><br><br>
<center>
<form method=post action="InsertStudent1.php">
<table border=1>
<tr>
<th>Student Id</th>
<td><input type=text name=txtid></td>
</tr>
<tr>
<th>Name</th>
<td><input type=text name=txtname></td>
</tr>
<tr>
<th>Physics</th>
<td><input type=text name=txtphy></td>
</tr>
<tr>
<th>Chemistry</th>
<td><input type=text name=txtchem></td>
</tr>
<tr>
<th>Maths</th>
<td><input type=text name=txtmath></td>
</tr>
<tr>
<td></td>
<td><input type=submit value=Submit name=btnSubmit></td>
</tr>
</table>
<pre>
<?php
if(isset($_POST['btnSubmit']))
{
$id=$_POST['txtid'];
$name=$_POST['txtname'];
$phy=$_POST['txtphy'];
$chem=$_POST['txtchem'];
$math=$_POST['txtmath'];
$mycon=mysqli_connect("localhost","root","","Library") or die("Connection not success");
echo "Connection sucees<br>";
// $sql="insert into studentdata values(?,?,?,?,?)";
// $ps=$mycon->prepare($sql);
// $ps->bind_param("isiii", $id,$name,$phy,$chem,$math);
// $ps->execute();
// echo " Record inserted....";
$sql="select * from studentdata where sid=?";
$ps=$mycon->prepare($sql);
$ps->bind_param("i", $id);
echo $ps->execute_query();
// while($row=mysqli_fetch_assoc($record))
// {
// echo $row['sid']." ".$row['sname']." ".$row['course']."<br>";
// }
$ps->close();
$mycon->close();
// i-integer , s-string , d-double,b-Blob
}
?>
</pre>
</center>
</body>
</html>
Program 3
<?php include 'FrontPage.php'?>
<html>
<body>
<br><br><br><br><br><br><br><br><br><br>
<center>
<form method=post action="StudentDelete.php">
<table border=1>
<tr>
<th>Student Id For Delete</th>
<td><input type=text name=txtid></td>
</tr>
<tr>
<td></td>
<td><input type=submit value=Search name=btnSubmit></td>
</tr>
</table>
</form>
<pre>
<?php
if(isset($_POST['btnSubmit']))
{
$stid=$_POST['txtid'];
session_start();
$_SESSION['studid']=$stid;
$mycon=mysqli_connect("localhost","root","","Library") or die("Connection not success");
//echo "Connection sucees<br>";
$sql="select * from studentdata where sid=".$stid;
$record=$mycon->query($sql);
if(mysqli_num_rows($record)>0)
{
?>
<table border=1>
<tr>
<th>Roll No</th><th>Name</th><th>Phy</th><th>Chem</th><th>Maths</th>
</tr>
<tr>
<?php
while($row=mysqli_fetch_assoc($record))
{
echo "<td>". $row['sid']."</td>";
echo "<td>". $row['sname']."</td>";
echo "<td>". $row['phy']."</td>";
echo "<td>". $row['chem']."</td>";
echo "<td>". $row['math']."</td>";
echo "<form method=post action=DeleteData.php>";
echo "<td><input type=submit value=Delete></td>";
echo "</form>";
}
}
else
echo "<font color=red size=5>Record not found</font>";
}
?>
</tr>
</pre>
</center>
</body>
</html>
Program 4
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<meta name="generator" content="Web Page Maker">
<style type="text/css">
/*----------Text Styles----------*/
.ws6 {font-size: 8px;}
.ws7 {font-size: 9.3px;}
.ws8 {font-size: 11px;}
.ws9 {font-size: 12px;}
.ws10 {font-size: 13px;}
.ws11 {font-size: 15px;}
.ws12 {font-size: 16px;}
.ws14 {font-size: 19px;}
.ws16 {font-size: 21px;}
.ws18 {font-size: 24px;}
.ws20 {font-size: 27px;}
.ws22 {font-size: 29px;}
.ws24 {font-size: 32px;}
.ws26 {font-size: 35px;}
.ws28 {font-size: 37px;}
.ws36 {font-size: 48px;}
.ws48 {font-size: 64px;}
.ws72 {font-size: 96px;}
.wpmd {font-size: 13px;font-family: 'Arial';font-style: normal;font-weight: normal;}
/*----------Para Styles----------*/
DIV,UL,OL /* Left */
{
margin-top: 0px;
margin-bottom: 0px;
}
</style>
<script language="JavaScript1.4" type="text/javascript">
<!--
function jsPlay(soundobj) {
var thissound= eval("document."+soundobj);
try {
thissound.Play();
}
catch (e) {
thissound.DoPlay();
}
}
//-->
</script>
<script language="javascript" type="text/javascript">
<!--
function MM_swapImgRestore() {
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() {
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) {
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() {
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
</head>
<body>
<div id="image1" style="position:absolute; overflow:hidden; left:35px; top:18px; width:149px; height:125px; z-index:0"><img src="images/123.jpg" alt="" title="" border=0 width=149 height=125></div>
<div id="image2" style="position:absolute; overflow:hidden; left:1524px; top:17px; width:164px; height:138px; z-index:1"><img src="images/123.jpg" alt="" title="" border=0 width=164 height=138></div>
<div id="nav10d" style="position:absolute; left:177px; top:117px; z-index:2"><a onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('nav10','','images/nav2729786710a.gif',1)" href="FrontPage.php"><img name="nav10" onLoad="MM_preloadImages('images/nav2729786710a.gif')" alt="" border=0 src="images/nav2729786710i.gif"></a></div>
<div id="nav11d" style="position:absolute; left:351px; top:117px; z-index:2"><a onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('nav11','','images/nav2729786711a.gif',1)" href="InsertStudent1.php"><img name="nav11" onLoad="MM_preloadImages('images/nav2729786711a.gif')" alt="" border=0 src="images/nav2729786711i.gif"></a></div>
<div id="nav12d" style="position:absolute; left:525px; top:117px; z-index:2"><a onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('nav12','','images/nav2729786712a.gif',1)" href="SelectStudent.php"><img name="nav12" onLoad="MM_preloadImages('images/nav2729786712a.gif')" alt="" border=0 src="images/nav2729786712i.gif"></a></div>
<div id="nav13d" style="position:absolute; left:699px; top:117px; z-index:2"><a onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('nav13','','images/nav2729786713a.gif',1)" href="StudentDelete.php"><img name="nav13" onLoad="MM_preloadImages('images/nav2729786713a.gif')" alt="" border=0 src="images/nav2729786713i.gif"></a></div>
<div id="nav14d" style="position:absolute; left:873px; top:117px; z-index:2"><a onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('nav14','','images/nav2729786714a.gif',1)" href="StudentUpdate.php"><img name="nav14" onLoad="MM_preloadImages('images/nav2729786714a.gif')" alt="" border=0 src="images/nav2729786714i.gif"></a></div>
<div id="nav15d" style="position:absolute; left:1047px; top:117px; z-index:2"><a onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('nav15','','images/nav2729786715a.gif',1)" href="#"><img name="nav15" onLoad="MM_preloadImages('images/nav2729786715a.gif')" alt="" border=0 src="images/nav2729786715i.gif"></a></div>
<div id="nav16d" style="position:absolute; left:1221px; top:117px; z-index:2"><a onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('nav16','','images/nav2729786716a.gif',1)" href="#"><img name="nav16" onLoad="MM_preloadImages('images/nav2729786716a.gif')" alt="" border=0 src="images/nav2729786716i.gif"></a></div>
<div id="nav17d" style="position:absolute; left:1395px; top:117px; z-index:2"><a onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('nav17','','images/nav2729786717a.gif',1)" href="#"><img name="nav17" onLoad="MM_preloadImages('images/nav2729786717a.gif')" alt="" border=0 src="images/nav2729786717i.gif"></a></div>
</body>
</html>
Program 5
<?php include 'FrontPage.php'?>
<html>
<body>
<br><br><br><br><br><br><br><br><br><br>
<center>
<form method=post action="SelectStudent.php">
<table border=1>
<tr>
<th>Student Id</th>
<td><input type=text name=txtid></td>
</tr>
<tr>
<td></td>
<td><input type=submit value=Search name=btnSubmit></td>
</tr>
</table>
<pre>
<?php
if(isset($_POST['btnSubmit']))
{
$stid=$_POST['txtid'];
$mycon=mysqli_connect("localhost","root","","Library") or die("Connection not success");
//echo "Connection sucees<br>";
$sql="select * from studentdata where sid=".$stid;
$record=$mycon->query($sql);
if(mysqli_num_rows($record)>0)
{
?>
<table border=1>
<tr>
<th>Roll No</th><th>Name</th><th>Phy</th><th>Chem</th><th>Maths</th>
</tr>
<?php
while($row=mysqli_fetch_assoc($record))
{
echo "<tr>";
echo "<td>". $row['sid']."</td>";
echo "<td>". $row['sname']."</td>";
echo "<td>". $row['phy']."</td>";
echo "<td>". $row['chem']."</td>";
echo "<td>". $row['math']."</td>";
echo "</tr>";
}
}
else
echo "<font color=red size=5>Record not found</font>";
}
?>
</pre>
</center>
</body>
</html>
Program 6
<html>
<head><title>User Login Application</title>
<body>
<center>
<form method=post action="<?php echo $_SERVER['PHP_SELF'] ?>" >
<table border=1>
<tr>
<th>User Name: </th>
<td><input type=text name=txtuser></td>
</tr>
<tr>
<th>Password: </th>
<td><input type=password name=txtpass></td>
</tr>
<tr>
<td></td>
<td><input type=submit value=Submit name=submitbtn></td>
</tr>
<table>
</form>
<?php
if(isset($_POST['submitbtn']))
{
$user=$_POST['txtuser'];
$pass=$_POST['txtpass'];
$mycon=mysqli_connect("localhost","root","","Library") or die("Connection not success");
$sql="select * from login where username='".$user."' and password='".$pass."'" ;
$record=$mycon->query($sql);
if(mysqli_num_rows($record)>0)
header("Location:FrontPage.php");
else
echo "<font color=red size=5>Invalid userid or password</font>";
}
?>
</center>
</body>
</html>