Re: if statement with or comparison (newbie)
| From: | tedd | Date: | Fri, 08 Sep 2006 22:38:37 +0000 |
| Subject: | Re: if statement with or comparison (newbie) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-241516@lists.php.net to get a copy of this message | ||
At 5:03 PM -0400 9/8/06, JD wrote:
I'm trying to set up a simple conditional, something like this:
Here is what I have tried:
if ($_REQUEST['id'] != ("black" or "white")) {
In all of the answers given thus far, no one mentioned that the use of $_REQUEST has a security issue with regard to where the $_REQUEST originated.
$_REQUEST is an array consisting of $_GET, $_POST and $_COOKIE values and as such, you don't know where the data came from and that might be important.
So, wouldn't it be better to recommend that the poster use $_GET, $_POST, or $_COOKIE instead of $_REQUEST?
Just an idea -- comments?
tedd
--
-------
http://sperling.com http://ancientstones.com http://earthstones.com