Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- if ($_SERVER['REQUEST_METHOD'] != 'POST'): // Check if form has been submitted
- ?>
- <!-- Show the form when user first visits site -->
- <label> Enter the following info to continue:</label>
- <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="POST">
- <input type="text" name="roll_no" id="roll_no" /><br/>
- <input type="text" name="dob" id="dob" /><br/>
- <input type="submit"/>
- </form>
- <?php else: // Form has been submitted ?>
- <!-- Do your stuff here
- (Like use PHP to test validity of submitted data
- and undertake various actions based on the data) -->
- <h1> Hello! </h1>
- Your Roll No is <?php echo $_POST['roll_no']; ?> <br/>
- Your DOB is <?php echo $_POST['dob']; ?>
- <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement