Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Ban Script
#1
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
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);
}

?>
Reply


Messages In This Thread
Ban Script - by brett7 - 10-08-2009, 01:52 PM
RE: Ban Script - by Headshot - 10-08-2009, 01:54 PM
RE: Ban Script - by brett7 - 10-08-2009, 01:58 PM
RE: Ban Script - by Headshot - 10-08-2009, 02:04 PM
RE: Ban Script - by brett7 - 10-08-2009, 02:09 PM
RE: Ban Script - by Project Evolution - 10-10-2009, 09:24 AM
RE: Ban Script - by Spl3en - 10-13-2009, 05:55 PM
RE: Ban Script - by manipulate - 10-20-2009, 09:51 PM
RE: Ban Script - by ethical_john - 10-21-2009, 09:15 AM
RE: Ban Script - by Gaijin - 10-21-2009, 09:26 AM
RE: Ban Script - by ethical_john - 10-21-2009, 09:28 AM
RE: Ban Script - by Gaijin - 10-21-2009, 09:32 AM
RE: Ban Script - by ethical_john - 10-21-2009, 09:34 AM
RE: Ban Script - by Gaijin - 10-21-2009, 09:44 AM
RE: Ban Script - by ethical_john - 10-21-2009, 09:52 AM
RE: Ban Script - by Gaijin - 10-21-2009, 09:56 AM
RE: Ban Script - by ethical_john - 10-21-2009, 10:02 AM
RE: Ban Script - by Gaijin - 10-21-2009, 10:12 AM
RE: Ban Script - by ethical_john - 10-21-2009, 10:25 AM
RE: Ban Script - by Gaijin - 10-21-2009, 10:30 AM
RE: Ban Script - by ethical_john - 10-21-2009, 10:33 AM
RE: Ban Script - by Gaijin - 10-21-2009, 10:38 AM
RE: Ban Script - by ethical_john - 10-21-2009, 10:41 AM
RE: Ban Script - by Gaijin - 10-21-2009, 10:43 AM
RE: Ban Script - by ethical_john - 10-21-2009, 10:45 AM
RE: Ban Script - by Omniscient - 10-21-2009, 11:04 AM
RE: Ban Script - by manipulate - 10-22-2009, 03:47 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  php form script with upload script help andrewjs18 4 3,341 10-07-2010, 11:46 AM
Last Post: JMK940
  Auto Ban IP's & Host's zone 2 1,189 11-06-2009, 09:15 PM
Last Post: zone

Forum Jump:


Users browsing this thread: 1 Guest(s)