我想用两个按钮接受和拒绝在网站上制作介绍页面或弹出窗口。如果客户点击接受介绍页面没有显示,请查看将来点击接受的访问者。我知道脚本可以用cookies做任何想法吗?
答案 0 :(得分:0)
有两种微不足道的方式。
PHP方式(在您的主页上):
// did they accept to enter site? if there is not a cookie then no
if (!isset($_COOKIE['enter']))
{
header("Location: intro.php");
die();
}
在intro.php上,当用户接受访问该站点时进行处理。要设置cookie,请执行以下操作:
setcookie("enter", true);
或者你可以使用jquery.cookie来检查是否使用JavaScript设置了cookie。如果不是,请显示JavaScript模式弹出窗口。
希望这会把你推向正确的方向。祝你好运!