Unlimited Faxes, No Fees, Dedicated Phone Number
|
|
A very powerful feature of PHP is the way it handles HTML forms! PHP Form HandlingThe most important thing to notice when dealing with HTML forms and PHP is that any form element in an HTML page will automatically be available to your PHP scripts. Look at the following example of an HTML form:
The example HTML page above contains two input fields and a submit button. When the user fills in this form and hits the submit button, the "welcome.php" file is called. The "welcome.php" file looks like this:
A sample output of the above script may be:
Here is how it works: The $_POST["name"] and $_POST["age"] variables are automatically set for you by PHP. The $_POST contains all POST data. Note: If the method attribute of the form is GET, then the form information will be set in $_GET instead of $_POST. |