Re: checking the referer

From: Date: Tue, 05 Dec 2000 04:48:44 +0000
Subject: Re: checking the referer
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-28684@lists.php.net to get a copy of this message
On Mon, 4 Dec 2000, Ken Nagorski wrote: > Hi, > > Am I crazy? I think I am. As far as I know this is a logical or, > but it fails every time. I keep looking at it thinking I know I am making > a simple mistake but I have been screwinf with it forever. ? > > Thank you > Ken > > if(($HTTP_REFERER != > 'http://www.mydomain.com/devel/logon.html') > || ($HTTP_REFERER != > 'http://www.mydomain.com/devel/logon.php')) > { > sleep(5); > echo("$HTTP_REFERER<BR>"); > echo("<B>BAD REFERER</B>"); > exit(); > } Yes, because no matter what $HTTP_REFERER is, it will never be both. You want an and, not an or. Matt

« previous php.general (#28684) next »