<?php
$url = 'put your ip banlist filename here';
$iplist = explode(',', file($url));
for ($j=0; $j < count($iplist); $j++)
{
if(preg_match('#' . $iplist[$j] . '#i', $_SERVER['REMOTE_ADDR']))
{
// This is where you put what you want to happen
// For now we will just kill the script because I am lazy, you can change it to a redirect later
die('You are banned.');
}
}
?>
Sorry I didnt do any debugging or syntax checking and Yahoo Answers removes extra whitespace so bad formatting. Hopefully I didn't make any mistakes, try it out
$url = 'put your ip banlist filename here';
$iplist = explode(',', file($url));
for ($j=0; $j < count($iplist); $j++)
{
if(preg_match('#' . $iplist[$j] . '#i', $_SERVER['REMOTE_ADDR']))
{
// This is where you put what you want to happen
// For now we will just kill the script because I am lazy, you can change it to a redirect later
die('You are banned.');
}
}
?>
Sorry I didnt do any debugging or syntax checking and Yahoo Answers removes extra whitespace so bad formatting. Hopefully I didn't make any mistakes, try it out