RE: [PHP-WIN] Re: If code not working?
| From: | Sean Rowe | Date: | Wed, 04 Jan 2006 18:46:10 +0000 |
| Subject: | RE: [PHP-WIN] Re: If code not working? | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-26612@lists.php.net to get a copy of this message | ||
Just curious as to why the 0 is at the end of the 'if' statement? 0 is
never true, so I guess I don't see the point?
-----Original Message-----
From: El Bekko [mailto:elbekko@gmail.com]
Sent: Wednesday, January 04, 2006 12:21 PM
To: php-windows@lists.php.net
Subject: [PHP-WIN] Re: If code not working?
Christopher Malton wrote:
> To all,
> I appear to have a problem with my If statement. No error is
> presented to me, but does anyone see what is wrong. IP addresses masked
> for safety & security.
>
>
> Code as follows:
> <?php
> if(
> ($_SERVER["REMOTE_ADDR"]=="x.x.x.x")||
> ($_SERVER["REMOTE_ADDR"]=="y.y.y.y")||
> 0
> ){
> header("Location: /access_disabled.php");
> exit();
> }
> ?>
>
> Chris
Ehm... It should work. I've rewritten it a tad:
<?php
if($_SERVER["REMOTE_ADDR"]=="x.x.x.x" ||
$_SERVER["REMOTE_ADDR"]=="y.y.y.y" || 0)
{
header("Location: /access_disabled.php");
exit();
}
?>
--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php