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