as

Write a PHP script to demonstrate Form Data Handling using Post methods.

Write a PHP script to demonstrate Form Data Handling using Post methods.   



Code :-

<html>
          <head>
                  <title>Login Form</title>
          </head>
<body>
        <h1>It is POST Method</h1>
<form name="login" method="POST" action="#">
          <table align="Center">
          <tr>
                    <td>Enter Name : </td>
                    <td><input type="text" name="txtname"/></td>
          </tr>
          <tr>
                    <td>Enter Roll No.</td>
                    <td><input type="text" name="txtrno"/></td>
          </tr>
          <tr>
                    <td></td>
                    <td><input type="submit" value="LOGIN" /></td>
          </tr>
          </table>
</form>
<?php
          $name = $_POST['txtname'];
          $rno = $_POST['txtrno'];
          echo "Name is :-  ".$name."<br>";
          echo "RollNo is :- ".$rno;
?>
</body>
</html>

Output :-