IF ELSEIF ELSE??
| From: | Gerard Samuel | Date: | Fri, 03 Aug 2001 21:51:47 +0000 |
| Subject: | IF ELSEIF ELSE?? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-61180@lists.php.net to get a copy of this message | ||
Whats wrong with this piece of code. Basically, it not doing the last else statement.
1. If no form was submitted exit.
2. If a form was submitted, check for 'empty' strings.
3. If all is good, echo "xxxxx";
Thanks all.
if (!$HTTP_POST_VARS) { exit(); }
elseif ($HTTP_POST_VARS) {
if (!$Age) { echo "Please enter your age.<br>\n"; } if (!$Email) { echo "Please enter your email.<br>\n"; } if (!$State) { echo "Please enter your Location.<br>\n";} }
else
echo "Thanks for your submission.";