= $botblocker_time + $botblocker_itime*$botblocker_imaxvisit)
{
touch($botblocker_iplogdir.$botblocker_ipfile, $botblocker_time + $botblocker_itime*($botblocker_imaxvisit-1) + $botblocker_ipenalty);
header("HTTP/1.0 503 Service Temporarily Unavailable");
header("Connection: close");
header("Content-Type: text/html");
echo "
Server under heavy load
";
echo "Please wait $botblocker_ipenalty seconds and try again
";
$botblocker_fp = fopen($botblocker_iplogdir.$botblocker_iplogfile, "a");
if ($botblocker_fp)
{
$botblocker_useragent = "";
if (isset($_SERVER["HTTP_USER_AGENT"])) $botblocker_useragent = $_SERVER["HTTP_USER_AGENT"];
fputs($botblocker_fp, $_SERVER["REMOTE_ADDR"]." ".date("d/m/Y H:i:s")." ".$botblocker_useragent."\n");
fclose($botblocker_fp);
}
exit();
}
touch($botblocker_iplogdir.$botblocker_ipfile, $botblocker_newtime);
?>