[PHP] if elseif else

2002-04-19 Thread Gerard Samuel
I redoing some code, and the original author has code like if elseif elseif elseif else I have always known it to have just one elseif, not multiple ones. I was going to move it to a switch/case, but there is no common switch. So I wanted to know if its technically ok, or just ok to use multiple

RE: [PHP] if elseif else

2002-04-19 Thread Leotta, Natalie (NCI/IMS)
You can use as many elseifs as you need. I'm not sure how it affects performance, but it works (I have one that goes through all 50 states). -Natalie -Original Message- From: Gerard Samuel [mailto:[EMAIL PROTECTED]] Sent: Friday, April 19, 2002 10:02 AM To: PHP Subject: [PH

Re: [PHP] if elseif else

2002-04-19 Thread The_RadiX
Nope.. That is fine.. I use it all the time.. It's quite acceptable.. - Original Message - From: "Gerard Samuel" <[EMAIL PROTECTED]> To: "PHP" <[EMAIL PROTECTED]> Sent: Saturday, April 20, 2002 12:01 AM Subject: [PHP] if elseif else > I re

Re: [PHP] IF ELSEIF ELSE??

2001-08-03 Thread Richard Baskett
if (!$HTTP_POST_VARS) exit(); else { if (!$Age) { echo "Please enter your age.\n"; } if (!$Email) { echo "Please enter your email.\n"; } if (!$State) { echo "Please enter your Location.\n";} if ($Age && $Email && $State) echo "Thanks for your submission."; } Your if and else statements

[PHP] Re:[PHP] IF ELSEIF ELSE??

2001-08-03 Thread Jack Sasportas
First you should manage your code nicer so that it is easier to read and troubleshoot. Go through this to find my notes... if (!$HTTP_POST_VARS) { exit();} elseif ($HTTP_POST_VARS) { if (!$Age) { echo "Please enter your age.\n"; } if Why would

Re: [PHP] Re:[PHP] IF ELSEIF ELSE??

2001-08-03 Thread Richard Baskett
Just curious but that last else you told him to put in... what is that referring to? There is already an else statement, you can't have another. Unless you're putting the else statement after the if (!$State) which you would need to subtract the "}" before the else, but this would give you undesi

Re: [PHP] Re:[PHP] IF ELSEIF ELSE??

2001-08-03 Thread Jack Sasportas
Yes, I see what you mean... In showing why the last section didn't work, I messed up the actual overall logic of the code. I should have noticed that...nice catch so for clarification where it says (MARK) should be echo "Thanks for your submission."; } Thanks... Jack Sasportas wrote: >