Orionsbelter Posted May 16, 2008 Share Posted May 16, 2008 Can anyone give me a script to ip ban a ip please. thanks Quote Link to comment Share on other sites More sharing options...
conker87 Posted May 16, 2008 Share Posted May 16, 2008 A simple google search brought up: http://www.phpit.net/code/ban-ip-addresses/ Quote Link to comment Share on other sites More sharing options...
miracle_potential Posted May 16, 2008 Share Posted May 16, 2008 Well I recommend doing it with your .htaccess file Quote Link to comment Share on other sites More sharing options...
jonsjava Posted May 16, 2008 Share Posted May 16, 2008 <?php $banned = array("127.0.0.1", "0.0.0.0", "1.1.1.1"); //these are example IP addresses if (in_array($_SERVER['REMOTE_ADDR'], $banned)){ //boot 'em! } else{ //let them in! } ?> Quote Link to comment Share on other sites More sharing options...
947740 Posted May 16, 2008 Share Posted May 16, 2008 You could use a database and compare the banned IPs in there to the IP of the user. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.