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 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.
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.