Jump to content

Simple Logical OR


barkster

Recommended Posts

I'm missing something really simple here. I want to restrict a site from ip other than the two listed. If it doesn't match either of the ip addresses I want to redirect. If I just look at one ip it works but when I tell it can equal either it redirects no matter if the ip is correct. I'm missing something with the || here.

[code]
<?php
$domain = GetHostByName($REMOTE_ADDR);
//accetable IP addresses 192.168.10.1 or 192.168.10.5
if (($domain <> '192.168.10.1') || ($domain <> '192.168.10.5')) {
    header("Location: Failed.php");
    }
print($domain);
?>
[/code]
Link to comment
https://forums.phpfreaks.com/topic/5524-simple-logical-or/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.