Re: What's wrong with this IF statement?
| From: | Chris Shiflett | Date: | Thu, 22 Apr 2004 21:53:35 +0000 |
| Subject: | Re: What's wrong with this IF statement? | ||
| References: | 1 | Groups: | php.db php.general |
| Request: | Send a blank email to php-db+get-34053@lists.php.net to get a copy of this message | ||
--- Robert Sossomon <robert@gcnorris.com> wrote:
> if ($cat_id != "53" || $cat_id != "54" || $cat_id != "55" ||
> $cat_id
> != "117" || $cat_id != "118" || $cat_id != "74")
That looks like a pretty big logical flaw to me. Just read that out loud
to yourself. It should be clear that this statement is equivalent to:
if (true)
Hope that helps.
Chris
=====
Chris Shiflett - http://shiflett.org/
PHP Security - O'Reilly
Coming Fall 2004
HTTP Developer's Handbook - Sams
http://httphandbook.org/
PHP Community Site
http://phpcommunity.org/