Add the following dummy IPs: 111.111.*, 222.222.222.222,333.*,444.444.444.*
Than, create a PHP file and add the following code:
- Code: Select all
function checkSecurity ()
{
// block ip file list (.inc)
$list = 'list.txt'; // change this to your list patch
$deny = array();
// open and read file
$fo = fopen($list, 'r');
$str = fread($fo, filesize($list));
fclose($fo);
$str = str_replace(",",'_',$str);
$ary = explode('_',$str);
for($i=0; $i < count($ary); $i++)
{
$deny[] = $ary[$i];
}
foreach($deny as $ip) {
if(eregi($ip,$_SERVER['REMOTE_ADDR'])) {
header("Location: http://google.com?q=fuckyou"); // change this for whatever you want.
exit();
}
}
}
usage:
DON'T FORGET TO INCLUDE THE FUNCTION FILE BEFORE CALLING THE FUNCTION!
- Code: Select all
require_once("ip_block.php");
checkSecurity();
As you can see, the list accepts wild card as well to include a range of IPs.
If the IP is found, the function redirects the user to whatever you set on [ header() ].
Have fun!