The $_GET and $_POST variables are used to retrieve information from forms, like user input ----------------------------------------------------------------------------------------------------------------------------------
PHP Form Handling
When you dealing HTML forms and PHP, any form element in an HTML page will automatically be available to your PHP scripts. For instances:
When u fills out the form above and click on the submit button, the form data is sent to a PHP file, called "welcome.php". A "welcome.php" file looks like this:
############################################################
The Output:
Welcome Ajaq!
You are 24 years old.
############################################################
Form Validation
User input should be validated on the browser whenever possible (by client scripts). Browser validation is faster and reduces the server load. A good way to validate a form on the server is to post the form to itself, instead of jumping to a different page. The user will then get the error message on the same page as the form and this makes it easier to detect the error.
.jpg)


0 comments:
Post a Comment