Posted on 2004-10-30
I had a previous question here before on banning certain IPs and redirect them to another page
I got the following code
/* put this at the top of your page */
$certain_ips = array('62.215','62.150','195.226','195.39','213.189','213.181','168.187','194.54');
foreach($certain_ips as $ip)
if(substr($_SERVER['REMOTE_ADDR'], 0, strlen($ip)) == $ip)
The IPs shown are the banned IPs in my site. The problem with this code that it bans only the first two IPs but the rest still can access the site normally.
Anyone can fix that plz?