RE: [PHP] IF ELSEIF ELSE??

From: Date: Fri, 03 Aug 2001 22:38:22 +0000
Subject: RE: [PHP] IF ELSEIF ELSE??
Groups: php.general 
Request: Send a blank email to php-general+get-61181@lists.php.net to get a copy of this message
Your if statement is saying: If $HTTP_POST_VARS is FALSE exit If $HTTP_POST_VARS is TRUE do blah. Else do the else statement... It's either true or false, that else statement will never get hit. -----Original Message----- From: Gerard Samuel [mailto:trini0@optonline.net] Sent: Friday, August 03, 2001 2:52 PM To: PHP Subject: [PHP] IF ELSEIF ELSE?? 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."; -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.general (#61181) next »