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)

Employee.html
<html>
<body>
<form method=get action="lic.php">
Enter Employee Name : <input type=text name=ename><br>
Enter Address : <input type=text name=address><br>
Enter Mobile No.<input type=text name=mobile><br>
<input type=submit value=Save>
</form>
</body>
</html>
Lic.php
<?php
       $ename=$_GET['ename'];
       $address=$_GET['address'];
       $mobile=$_GET['mobile'];
setcookie("ename",$ename);
setcookie("address",$address);
setcookie("mobile",$mobile);
echo"Hello $ename enter your LIC details <br><br>";
echo"<form method=get action=display.php>
                 Policy No.:<input type=text name=pno><br>
                 Policy Name:<input type=text name=name><br>
                 Premium : <input type=text name=premium><br>
<input type=submit value=Display>
</form>";
 ?>
Display.php
<?php
      $pno=$_GET['pno'];
      $name=$_GET['name'];
      $premium=$_GET['premium'];
    if(isset($_COOKIE['ename'])&&isset($_COOKIE['address'])&&isset($_COOKIE['mobile']))
   {
echo"<br><b>Employee Details </b><br>";
echo"Employee Name : ".$_COOKIE['ename']." <br>";
echo"Employee Address :".$_COOKIE['address']."<br>";
echo"Mobile No. : ".$_COOKIE['mobile']."<br>";
echo"<br><b>LIC Policy Details</b><br>";
echo"Policy No. : $pno<br>";
echo"Policy Name : $name<br>";
echo"Premium : $premium";
  }
?>

Comments

Popular posts from this blog

Create an XML file which gives details of books available in “ABC Bookstore” from following categories. 1)      Technical 2)      Cooking 3)      Yoga And elements in each category are in the following format.     …….     …….     ……. Save the file as “Book.xml” Create an application that reads “Book.xml” file into simple XML object. Display attributes and elements. (Hint:- Use simple_xml_load_file() function). 

Write a simple PHP program which implements Ajax for addition of two numbers

Consider the following relational database: Project (P_Group_No, Project_Title) Student (Seat no, Name, Class, P_Group_No) Write a PHP script to accept project title and display list of students those who are working in a particular project.