PHP防刷新页面代码!
作者: Mine @Ta
时间: 2015-01-06 22:31
点击: 60
session_start();
$allow_sep = "30000";
if (isset($_SESSION["post_sep"]))
{
if (time() - $_SESSION["post_sep"] < $allow_sep)
{
exit("请不要反复刷新,请30000秒后再来操作。");
}
else
{
$_SESSION["post_sep"] = time();
}
}
else
{
$_SESSION["post_sep"] = time();
}
转自网络。可优化