Re: wierd if statement problem

From: Date: Wed, 21 May 2003 06:38:01 +0000
Subject: Re: wierd if statement problem
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-148367@lists.php.net to get a copy of this message
check this $g = "1" ; if (($g!=="1") || ($g!=="2")) die("no"); or if (($g!="1") || ($g!="2")) die("no"); or if ($g!="1" || $g!="2") die("no"); none of these combinations work , i'm pretty sure this has worked for me in the past i'm running php 4.3.1 and apache 1.3 > Hi > > > deo> this is wierd i have not experienced this before , but i am doing > groupId deo> checking for my authentication system , say i'm logged is > as admin , but deo> also need to check for super user access > > deo> if (($_SESSION['groupID']!==1) || ($_SESSION['groupID']!==2)) > deo> i've > done deo> this before but for some reason its not working now ?? > > Why are you using !== ? Try != > Maybe $_SESSION['groupID'] equals '1' but not 1 > > > > > > > > > -- > Regards > > Anton

« previous php.general (#148367) next »