Program :
HTML Code
<?php// Start the session
session_start();
?>
<html>
<head>
<title>Employee Info</title>
</head>
<body><center>
<h3> Employee Details </h3>
<form action="EmpScript.php" method=post><br><br>
Emp No: <input type="text" id="empno" name="empno"><br><br>
Name: <input type="text" id="empname" name="empname"><br><br>
Address: <input type="text" name="address"><br><br>
<table>
<tr>
<td>
Select Gender :</td> <td><input type="radio" name="sex" value="male"
checked>Male
</td>
<td><input type="radio" name="sex" value="female">Female</td>
</tr>
</table>
<br><br>Phone No: <input type="text" name="phoneno"><br><br>
<input type=submit>
</form></center>
</body>
</html>
PHP Script : Filename - EmpScript.php
<?php// Set session variables
$_SESSION["Empno"] = $_POST["empno"];
$_SESSION["employeeaddress"] = $_POST["address"];
$_SESSION["employeesex"] = $_POST["sex"];
$_SESSION["employeephno"] = $_POST["phoneno"]; ?>
<center> <font color=Red><h2> Employee Details </h2></font><b>
<?php
echo "Employee No :".$_SESSION["Empno"]."<br>"."<br>";
echo "Address :".$_SESSION["employeeaddress"]."<br>"."<br>";
echo "Gender :".$_SESSION["employeesex"]."<br>"."<br>";
echo "Phone No :".$_SESSION["employeephno"]."<br>"."<br>";
</center></b>
?>
0 comments:
Post a Comment