//代理 IP 直接退出
empty($_SERVER['HTTP_VIA']) or exit('Access Denied');
//防止快速刷新
session_start();
$min_seconds = 1; //段[秒]
$max_refresh_times = 8; //刷新次数
session_start();
$_SESSION = array();
//print_r($_SESSION);die;
if(isset($_SESSION['refresh_times']) && isset($_SESSION['last_time'])){
if($_SESSION['refresh_times'] >= $max_refresh_times){
die;
}
if(time() - $_SESSION['last_time'] <= $min_seconds){//不排除刷接口嫌疑
$_SESSION['refresh_times'] += 1;
}else{
$_SESSION['refresh_times'] = 1;
$_SESSION['last_time'] = time();
}
}else{
$_SESSION['refresh_times'] = 1;
$_SESSION['last_time'] = time();
}
网友评论