1) Create a form to accept employee details like name, address and mobile number. Once the employee information is accepted, then accept LIC information like policy_no, name, premium. Display employee details and LIC details on next form.(use COOKIE)
emp.php
<HTML>
<BODY>
<FORM METHOD="POST" ACTION="lic.php">
<b>EName:</b><input type="text" name="ename"><br><br>
<b>Address:</b><input type="text" name="eaddr"><br><br>
<b>MobileNo:</b><input type="text" name="emob"><br><br>
<input type="submit" value="save">
</form>
</body>
</html>
lic.php
<html>
<head></head>
<body>
<FORM METHOD="POST" ACTION="display.php">
<?php
session_start();
$_SESSION["en"]=$_POST["ename"];
$_SESSION["ea"]=$_POST["eaddr"];
$_SESSION["em"]=$_POST["emob"];
setCookie('en',$_POST["ename"]);
setCookie('ea',$_POST["eaddr"]);
setCookie('em',$_POST["emob"]);
echo"Hello".$_SESSION["en"]."!Fill YOUR lic details";
echo"<b>Policy No:</b> <input type='text' name='polno'>";
echo"<b>Policy name:</b><input type='text' name='polname'>";
echo"<b>Policy premium:</b><input type='text' name='pre'>";
echo"<input type='submit' value='display'>";
?>
</body>
</form>
</html>
<?php
session_start();
echo"<b>Employee Details</b></br>";
echo"Name:".$_SESSION["en"]."<br>";
echo"Address:".$_SESSION["ea"]."<br>";
echo"Mobile no:".$_SESSION["em"]."<br>";
echo"<b>Policy Details</b></br>";
echo"Policy nO:".$_REQUEST["polno"]."<br>";
echo"Policy Name:".$_REQUEST["polname"]."<br>";
echo"Premium:".$_REQUEST["pre"]."<br>";
echo"<b>Employee Details</b></br>";
echo"Name:".$_COOKIE["en"]."<br>";
echo"Address:".$_COOKIE["ea"]."<br>";
echo"Mobile no:".$_COOKIE["em"]."<br>";
?>
emp.php
<HTML>
<BODY>
<FORM METHOD="POST" ACTION="lic.php">
<b>EName:</b><input type="text" name="ename"><br><br>
<b>Address:</b><input type="text" name="eaddr"><br><br>
<b>MobileNo:</b><input type="text" name="emob"><br><br>
<input type="submit" value="save">
</form>
</body>
</html>
lic.php
<html>
<head></head>
<body>
<FORM METHOD="POST" ACTION="display.php">
<?php
session_start();
$_SESSION["en"]=$_POST["ename"];
$_SESSION["ea"]=$_POST["eaddr"];
$_SESSION["em"]=$_POST["emob"];
setCookie('en',$_POST["ename"]);
setCookie('ea',$_POST["eaddr"]);
setCookie('em',$_POST["emob"]);
echo"Hello".$_SESSION["en"]."!Fill YOUR lic details";
echo"<b>Policy No:</b> <input type='text' name='polno'>";
echo"<b>Policy name:</b><input type='text' name='polname'>";
echo"<b>Policy premium:</b><input type='text' name='pre'>";
echo"<input type='submit' value='display'>";
?>
</body>
</form>
</html>
display.php
<?php
session_start();
echo"<b>Employee Details</b></br>";
echo"Name:".$_SESSION["en"]."<br>";
echo"Address:".$_SESSION["ea"]."<br>";
echo"Mobile no:".$_SESSION["em"]."<br>";
echo"<b>Policy Details</b></br>";
echo"Policy nO:".$_REQUEST["polno"]."<br>";
echo"Policy Name:".$_REQUEST["polname"]."<br>";
echo"Premium:".$_REQUEST["pre"]."<br>";
echo"<b>Employee Details</b></br>";
echo"Name:".$_COOKIE["en"]."<br>";
echo"Address:".$_COOKIE["ea"]."<br>";
echo"Mobile no:".$_COOKIE["em"]."<br>";
?>
2) Create employee table as follows
Bus(bno, bname, source, designation ).
Write Ajaxprogram to select the bus name and print the selected bus details.