10-08-2009, 01:52 PM
Here is a very effective IP Banning script.
Add the ips, one ip per line in ip.txt, u can even use * as a wildcard.
Just include the ban.php to all your web pages then you can add ips to the ips.txt file. The probelm is if you have a large ban file it can make your website slow. I did not make this.
ip.txt
ban.php
Add the ips, one ip per line in ip.txt, u can even use * as a wildcard.
Just include the ban.php to all your web pages then you can add ips to the ips.txt file. The probelm is if you have a large ban file it can make your website slow. I did not make this.
ip.txt
Code:
66.249.73.*
192.168.1.*
ban.php
Code:
<?php
/**
* @author optiplex
* @copyright 2008
* coded by optiplex, have fun ;)
*/
error_reporting(0);
if ($handle = fopen("ip.txt", "r+")) {
$ip = explode("
", fread($handle, filesize("ip.txt")));
for ($i = 0; $i < count($ip); $i++) {
$ip[$i] = str_replace("*", "(.*)", $ip[$i]);
if (ereg($ip[$i], $_SERVER['REMOTE_ADDR'])) {
header("Location: http://google.com/");
}
}
fclose($handle);
}
?>