PHP里防止刷新比较麻烦些,比如对计数器的防止刷新比较麻烦,不象asp里那样方便,但依然可以用比如下面的方法来实现
<?php
session_start();
$allow_sep = "30000";
if (isset($_SESSION["post_sep"]))
{
if (time() - $_SESSION["post_sep"] < $allow_sep)
{
exit("请不要反复刷新");
}
else
{
$_SESSION["post_sep"] = time();
}
}
else
{
$_SESSION["post_sep"] = time();
}
?>