note 8131 modified in empty by ronabop
| From: | ronabop@php.net | Date: | Thu, 31 Aug 2000 06:01:29 +0000 |
| Subject: | note 8131 modified in empty by ronabop | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-3747@lists.php.net to get a copy of this message | ||
The way I check form values is to use isset() and then compare it against an empty string; e.g.,
if (! isset($form["x"]) || ($form["x"] == ""))
error_bomb();
Using my method will allow people to submit 0 in form fields.
If the !isset is true then the string comparison won't be done since the expression is true at
that point, and if it is set then php does the string comparison.
http://www.php.net/manual/function.empty.php