PHP predefines the $_POST and $_GET variables to receive form information.
Form example, form.php:
<form name="commentform" method="post" action="comment.php"> <p> Salutation: <input type="text" name="nickname" /> </p> <input type="submit" value="Submit" /> </form>
In the above example, the form information contains a(name) input box and the submit button. When you click the submit button, the page will form information(user input of the title) submitted to the POST comment.php file processing.
<p>Your name is: <?php echo $_POST["nickname"];?> </p>
When we output the form.php input box name: John, click the submit button, comment.php page shows:
Your name is: John
The above is a simple form of the process, PHP pre-defined $_POST and $_GET variables to receive form information
HTML form validation
When a form is used to collect input from a customer, do not assume that the customer will conform to the input as envisaged. At any time to the customer's input to do a rigorous examination.
In some cases, in addition to client-side validation, may also need to server-side authentication(such as access to the database). This time in the PHP program to do a good logical validation. About server-side validation