View Single Post
Old 05-14-2003, 07:29 PM   #1 (permalink)
Boks
Registered User
 
Join Date: May 2003
Posts: 2
Boks is on a distinguished road
PHP ban IP range script

I know how to ban a single IP from visiting my site, but I need to ban a range.

I've got:

Code:
<?php
if (eregi ("123\.123\.123\.[1-100]", $HTTP_SERVER_VARS["REMOTE_ADDR"]))
{
print "Banned";
       exit();
}?>
but that seems to ban 123.123.123.1-255.

Any ideas how to do it or what I'm doing wrong? I've searched google (that's where I found the above code) and some script sites, but didn't have much luck finding what I need.

Thanks for any help
Boks is offline   Reply With Quote