if($_COOKIE['yes_cc']){
if(microtime(true) - $_COOKIE['yes_cc'] < 0.3){
redirect('http://127.0.0.1');
}
}else{
cookie('yes_cc',microtime(true),1); //不知道为什么,浏览器禁用 cookie 了这条语句还是能写入
}
if(!$_COOKIE['yes_cc']) redirect('http://127.0.0.1');
设置 cookie 过期时间为 1 秒,如果 0.3 秒内访问超过 1 次就跳转到 http://127.0.0.1,如果禁用 cookie 也跳转到 http://127.0.0.1
if(microtime(true) - $_COOKIE['yes_cc'] < 0.3){
redirect('http://127.0.0.1');
}
}else{
cookie('yes_cc',microtime(true),1); //不知道为什么,浏览器禁用 cookie 了这条语句还是能写入
}
if(!$_COOKIE['yes_cc']) redirect('http://127.0.0.1');
设置 cookie 过期时间为 1 秒,如果 0.3 秒内访问超过 1 次就跳转到 http://127.0.0.1,如果禁用 cookie 也跳转到 http://127.0.0.1