The validation of data that has been entered in a form is necessary in most cases. Why is important? For example, what good is holding a contest or sweepstakes if you can't notify the winner, because he or she entered an invalid telephone number or an incorrect address. What good is having a mailing list if the e-mail addresses on it aren't verified, and your mailing list just bounces back to you without reaching the subscribers and target audience.<br /><br />
Validating form entries saves you time and more importantly, it can save you money. And since somebody embossed the slogan "Time is money!", this should be very important for your web site!<br /><br />
Well when should we validate? There are two types of validation; client side and server side.
This article tells you how to pass variables to a PHP page using the query string, and how to access them from that page.
Have you ever seen a URL which looked like "www.example.com/pag e.php?mode=1&style=red"? Well, this page is being passed variables and their values through the query string, here the variables "mode" and "style" are being passed, with values "1" and "red" respectively. The question mark indicates the start of the query string and the ampersand, &, symbol seperates variable=value assignments.
In the PHP Tutorial you will learn about PHP Forms - Predefined variables, Reading input from forms and Using hidden fields to save state.PHP has several predefined variables called superglobals.Superglobals are always present and available in any PHP script.The superglobals are arrays of other variables.
In this code sample we will converting all applicable characters to HTML entities using htmlentities(). Using 'htmlentities' all characters which have HTML character entity equivalents are translated into these entities. .
This set of functions allows you to use simple PHP commands to generate complex forms containing many different inputs. It automatically outputs the HTML code for the form and makes it easy for you to process the input when the form is submitted.
If your PHP program is a dynamic web page (and it probably is) and your PHP program is dealing with user input (and it probably is), then you need to work with HTML forms.
Tips for simplifying, securing, and organizing your form-handling PHP code.
Form validation the process that occurs after the user clicks the submit button and before the form data processed by a PHP, JAVA or CGI program. In this tutorial, you'll learn how to intercept the submission and pass the form data through one validation tests. At the end of this tutorial, youŽll have a complete form validation framework in php wich can be seemless integerate in existing web applications.
Platform(s): Linux, Windows, FreeBSD, Mac OSX, Sun Solaris