Orionsbelter Posted May 16, 2008 Share Posted May 16, 2008 Can anyone give me a script to ip ban a ip please. thanks Link to comment https://forums.phpfreaks.com/topic/105900-how-can-i-ip-ban/ 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/ Link to comment https://forums.phpfreaks.com/topic/105900-how-can-i-ip-ban/#findComment-542696 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 Link to comment https://forums.phpfreaks.com/topic/105900-how-can-i-ip-ban/#findComment-542833 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! } ?> Link to comment https://forums.phpfreaks.com/topic/105900-how-can-i-ip-ban/#findComment-542842 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. Link to comment https://forums.phpfreaks.com/topic/105900-how-can-i-ip-ban/#findComment-542847 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.