Html file :
<html>
<body>
<form action="slip_4-1.php" method="post">
<center>
<h2> Enter Username : <input type="text" name="name"> </h2>
<h2> Enter Password : <input type="text" name="pwd"> </h2>
<input type="submit" value="Login">
</center>
</form>
</body>
</html>
Php file :
slip_4-1.php :
<?php
session_start();
$t=date("1,d-m-y h:i:s",time()+20);
if($_REQUEST['name']=='xyz’ && $_REQUEST['pwd']=='xyz')
{
?>
<html>
<body>
<h1> enter ur details
<form action="slip_4-2.php" method=get>
<input type='hidden' name='etime' value="
Notice: Undefined variable: t in /home/itprojectsco/public_html/awt25-s4.php on line 57
">
<h2> Enter Name :
<h2> Enter City :
<h2> Enter Phone No :
<input type=submit name=submit value=DISPLAY>
</form>
</body>
</html>
<?php
}
else echo "Invalid Username Or Password
"
?>
slip_4-2.php :
<?php
session_start();
$t=$_REQUEST['etime'];
$exp=date("1,d-m-y h:i:s",time());
if($t<$exp)
echo "Page Time Expired
";
else
{
echo "Name : ".$_REQUEST['uname']."
";
echo "City : ".$_REQUEST['city']."
";
echo "Phone NO : ".$_REQUEST['pno']."
";
session_destroy();
}
?>