Advertisement
sayanriju

Untitled

Mar 12th, 2015
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.70 KB | None | 0 0
  1. <?php
  2. if ($_SERVER['REQUEST_METHOD'] != 'POST'): // Check if form has been submitted
  3. ?>
  4. <!-- Show the form when user first visits site -->
  5. <label> Enter the following info to continue:</label>
  6. <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST">
  7.     <input type="text" name="roll_no" id="roll_no" /><br/>
  8.     <input type="text" name="dob" id="dob" /><br/>
  9.     <input type="submit"/>
  10. </form>
  11. <?php else: // Form has been submitted ?>
  12.  
  13. <!-- Do your stuff here
  14. (Like use PHP to test validity of submitted data
  15. and undertake various actions based on the data) -->
  16.  
  17. <h1> Hello! </h1>
  18. Your Roll No is <?php echo $_POST['roll_no']; ?> <br/>
  19. Your DOB is <?php echo $_POST['dob']; ?>
  20.  
  21. <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement