Tuesday, August 3, 2010

Ban IP range:

$getip $_SERVER["REMOTE_ADDR"]; $banned_ip = array(); $banned_ip[] = '194.9.94.*'$banned_ip[] = '77.105.2.*';


foreach(
$banned_ip as $banned)
$blacked=str_replace('*'''$banned); $len=strlen($blacked);
if (
$ip==$blacked || substr($getip0$len)==$blacked)
{
echo 
'You are banned!';
exit;
}
}  

No comments:

Post a Comment