I am trying to implement a bruteforce check on a loginpage. It logs the logins from a certain ip. If there are more than 10 it will stop saving the logins in the database and will set the $nopage variable to 1.
$ip=$_SERVER['REMOTE_ADDR'];
$res_check_bruteforce=$teste->query("select count(id),max(time) from bruteforce where ip='$ip'");
echo $teste->error;
$brut_info=$res_check_bruteforce->fetch_row();
if($brut_info[0]>=10){
$nopage=1;
}
Then, before echoing the login page code, i put a check:
if($nopage)header("HTTP/1.1 503 Service Temporarily Unavailable");
else .... output login page
The redirect works but the page is blank. The source of the page is blank too. What I am doing wrong?