我已使用此功能来防止垃圾邮件查询: 但我想让它每5秒允许两次查询
function antiSpam($seconds) {
if(!isset($_SESSION['last_query']))
$_SESSION['last_query'] = microtime(true);
if($_SESSION['last_query'] >= microtime(true))
exit(header('Location: https://mywebsite.com/spammer.php'));
$_SESSION['last_query'] = microtime(true)+$seconds;
}
antiSpam(5);
关于如何解决这个问题的任何想法?