Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/89.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在PHP和XSL中每天仅显示一次弹出模式_Php_Html - Fatal编程技术网

如何在PHP和XSL中每天仅显示一次弹出模式

如何在PHP和XSL中每天仅显示一次弹出模式,php,html,Php,Html,在我的网站上,我想显示一个弹出窗口,每天只显示一次调查。如果用户决定跳过调查,它将在几分钟后显示。如果他们点击提交按钮,弹出窗口将在第二天出现 前端的模式在xsl文件中-我想这里需要一个if语句 <article id="survey" class="my-survey"> <!-- Modal content is here --> <form> <a ty

在我的网站上,我想显示一个弹出窗口,每天只显示一次调查。如果用户决定跳过调查,它将在几分钟后显示。如果他们点击提交按钮,弹出窗口将在第二天出现

前端的模式在xsl文件中-我想这里需要一个if语句

<article id="survey" class="my-survey">
        <!-- Modal content is here -->
        <form>
            <a type="submit" class="button">Submit</a>
            <a href="/" class="skip">Skip for now</a>
        </form>
</article>

如果用户已提交或跳过,则需要存储一些信息。为此使用数据库或cookies。
    // Function to calculate if enough time has passed since submitting survey
    public static function enoughTimeElapsed(){
        $dt = "2011-03-19 10:05:44" ;
        $date = new DateTime($dt);
        $now = new DateTime();
        $diff = $now->diff($date);
        if($diff->days > 1) {
         // Done somethig here;
        }       
    }