Hey All,
I would like to have a script that allows 2 IP ranges to access a certain part of php page on my website. Right now all I can get is one range to work correctly. Here is what I have
PHP Code:
$ip = $_SERVER['REMOTE_ADDR'];
$ip = explode(".",$ip);
$ip_from = "192.168.0.1";
$ip_to = "192.168.255.254";
$ip_from2 = "10.0.0.1";
$ip_to2 = "10.255.255.254";
$ip_from = explode(".",$ip_from);
$ip_to = explode(".",$ip_to);
$ip_from2 = explode(".",$ip_from);
$ip_to2 = explode(".",$ip_to);
$a = 0;
while($a <= 3) {
if ($ip[$a] < $ip_from[$a] or $ip_from2[$a] || $ip[$a] > $ip_to[$a] or $ip_to2[$a]) { die("Access Denied"); }
$a++;
}
It however will not work, it still denies acces to the $ip_from2 and $ip_to2
Please help? Thank you