03-04-2011, 03:45 PM
|
#3 (permalink)
|
|
The Contributor
Join Date: Feb 2010
Posts: 69
Thanks: 16
|
ok so i changed it to
PHP Code:
$ban_ip_list = file("E:\domains\s\sb0t.tentun.co.uk\user\htdocs\Admin\docs\bannedfull.txt");
but i still get nothing and it still does nothing so i really dont get it.
full script is
PHP Code:
$ban_ip_list = file("E:\domains\s\sb0t.tentun.co.uk\user\htdocs\Admin\docs\bannedfull.txt");
$ban_ip_range = array('68.239.*', '188.2.*', '208.101.*');
/* Visitor's IP Address */
$user_ip = $_SERVER['REMOTE_ADDR'];
/* Message to output if the IP is in the ban list */
$msg = 'You do not have permission to access this page. If you think this is incorrect please e-mail tim@tentun.co.uk with your IP address. <a href="www.showmyip.com">www.showmyip.com</a>';
/* Message to output if the IP is in the ban list */
if(in_array($user_ip, $ban_ip_list))
{
exit($msg);
}
/* Check if the Visitor's IP is in our range's list */
if(!empty($ban_ip_range))
{
foreach($ban_ip_range as $range)
{
$range = str_replace('*','(.*)', $range);
if(preg_match('/'.$range.'/', $user_ip))
{
exit($msg);
}
}
}
?>
|
|
|
|