Retrieving Submitted Data
Once the data if filled up in forms. In order to retreive data use the similar approach as :
<?php // formtest2.php if (isset ( $_POST ['name'] )) { $name = $_POST ['name']; } else { $name = "(Not entered)"; ?> <html> <head> <title>Form Test</title> </head> <body> Your name is: $name <br /> <form method="post" action="formtest2.php"> What is your name? <input type="text" name="name" /> <input type="submit" /> </form> </body> </html> <?php } ?>
The only changes are a couple of lines at the start that check the $_POST associative array for the field name having been submitted. The previous topics introduced the $_POST associative array, which contains an element for each field in an HTML form.