June 2005
Intermediate
720 pages
20h 6m
English
A critical concept related to handling HTML forms is that of validating form data. In terms of both error management and security, you should absolutely never trust the data being entered in an HTML form. Whether erroneous data is purposefully malicious or just unintentionally inappropriate, it’s up to you—the Web architect—to test it against expectations.
Validating form data requires the use of conditionals and any number of functions, operators, and expressions. One common function to be used is isset(), which tests if a variable has a value (including 0, FALSE, or an empty string, but not NULL).
if (isset($var)) {
// $var has a value.
} else {
// $var does not have a value.
}
You saw an example of this in the preceding ...
Read now
Unlock full access