ok i am trying to stop my ip from getting exectuting the script in the else section but to view everything after that and i dont know what im doin wrong
$banned_ip = array();
$banned_ip[] = '60.00.000.00';
$banned_ip[] = '111.111.111.111';
foreach($banned_ip as $banned) {
$ip = $_SERVER['REMOTE_ADDR'];
if($ip == $banned){
print("404 Error");
} else{// Log visit;
$fp = fopen($counter, "a");
$line = $REMOTE_ADDR . "|" . $mday . $month . $year . "\n";
$size = strlen($line);
fputs($fp, $line, $size);
fclose($fp);}
}
i am trying for it no to do whats after the // Log visit but what happens is that it logs it and it shows "404 error" this script looks right to me but i dont know what im doin wrong