because i want to ban some ip start from 123. so i write this function, hope can help someone or someone give me more suggestion.. function banip($ip_address) { include('banip.php'); foreach ($ipaddress as $ban_ip) { if (preg_match("/^$ban_ip/", $ip_address)) { //header('location: http://somewhere.com'); // or anything you want! die(); } } } banip.php $ipaddress[]='123.'; // ban all start from 123. $ipaddress[]='123.123.'; // ban all start from 123.123 $ipaddress[]='123.123.123.'; // ban all start from 123.123.123 $ipaddress[]='123.123.123.123'; // ban 123.123.123.123 Code (markup):
$ipaddress[]='123.'; // ban all start from 123. $ipaddress[]='123.123.'; // ban all start from 123.123 complicated at first. i wrote a vb program for a port scanner starting from certain IP's. This will be like 100 lines of code or I would code it for you =) unless your willing to pay.
Oh I know that, but maybe they weren't aware they could do it with the .htaccess file. If you are using PHP you should check $_SERVER['REMOTE_ADDR'] for the IP address of the person viewing the page.