View Single Post
Old 08-05-2007, 03:55 PM   #17 (permalink)
unknownsheep
Recruit
 
Join Date: Aug 2007
Posts: 3
unknownsheep is on a distinguished road
Quote:
Originally Posted by DJMaze View Post
$ip_from = "192.168.0.0";

vs

$ip_from = "19.216.80.0";

What do both result in after you did str_replace(".","",$ip_from) in both?

And no, don't ask about IPv6 routines!!!!
Ahh, didn't think so far.

How about?

PHP Code:
$ip $_SERVER['REMOTE_ADDR'];
$ip explode(".",$ip);

$ip_from "192.168.0.0";
$ip_to "192.168.255.255";

$ip_from explode(".",$ip_from);
$ip_to explode(".",$ip_to);

$a 0;
while(
$a <= 3) {
if (
$ip[$a] < $ip[$a] || $ip[$a] > $ip_to[$a]) { die("Denied"); }
$a++;

unknownsheep is offline   Reply With Quote