php防止刷点击数的方法

    function RefreshHit($parameter,$ip){
        session_start();
        $allowTime = 1800;
        $allowT = md5($ip.$parameter);
        if(!isset($_SESSION[$allowT])){
            $refresh = true;
            $_SESSION[$allowT] = time();
        }elseif(time() - $_SESSION[$allowT]>$allowTime){
            $refresh = true;
            $_SESSION[$allowT] = time();
        }else{
            $refresh = false;
        }
        return $refresh;
    }
原文地址:https://www.cnblogs.com/xcxc/p/3132562.html