Hello there, i make this script but its not working how need to be ... hope someone can tell me what its the problem // ------------ Ip`s Not Allow $ips_class = array( '66.249', '66.196' ); foreach($ips_class as $ip_class) { echo $ip_class; if (!preg_match("~$ip_class~i", $_SERVER["REMOTE_ADDR"])) { $ip_status = "on"; } } PHP:
$ips_list = array('ip1', 'ip2', 'ip3'); $ip_status = "off"; if (!in_array($_SERVER["REMOTE_ADDR"], $ips_list)) { $ip_status = "on"; } PHP: This is the simplest method
For some reason, I thought the reputation + comment thing displayed within a user's post. Regardless, follow ^ his advice. That method will be quicker on your server.