復制代碼 代碼如下:
<?php
session_start();
$k=$_GET['k'];
$t=$_GET['t'];
$allowTime = 1800;//防刷新時間
$ip = get_client_ip();
$allowT = md5($ip.$k.$t);
if(!isset($_SESSION[$allowT]))
{
$refresh = true;
$_SESSION[$allowT] = time();
}elseif(time() - $_SESSION[$allowT]>$allowTime){
$refresh = true;
$_SESSION[$allowT] = time();
}else{
$refresh = false;
}
?>