Re: Newbie Problem with an IF Statement

From: Date: Wed, 05 Mar 2003 23:38:02 +0000
Subject: Re: Newbie Problem with an IF Statement
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-138393@lists.php.net to get a copy of this message
What the heck? The string "[status]='active'" doesn't check anything. It is converted to boolean by the if statment, which will be true, as it's not an empty string. I'm guessing you want to use if($status=='active'){ Hunter, Jess wrote:
I have a short bit of code that contains an if/else that is causing me some trouble, I am sure that the answer is staring me straight in the face, and I am not seeing it. Can someone take a look and see where I am coding wrong? <SNIPPET> if ("[status]='active'"){ print ("the active line\n"); } else { print ("inactive line\n"); } </SNIPPET> Thanks in advance Jess
-- The above message is encrypted with double rot13 encoding. Any unauthorized attempt to decrypt it will be prosecuted to the full extent of the law.

« previous php.general (#138393) next »