我有这段代码,以确保用户在转到域名的其他页面之前“同意”协议
$agreement_check = $_SESSION['agreement'];
$current_path = $_SERVER['REQUEST_URI'];
if($agreement_check!="yes" && (!strstr($current_path,"/agree/")) )
{
if(!header("Location: " . $domainURL . "login"))
{ die("Agreement check expire."); }
}
There 2 buttons in this /agree page
1是同意,另一个是不同意
if($final_check=="yes")
{
$_SESSION['agreement'] = "yes";
if(!header('Location: ' . $domainURL))
{
die('Server Error.');
}
}
如果同意,页面将设置
$_SESSION['agreement'] = "yes";
否则会重定向到主页
如果不同意,它将重定向到登录页面。
问题是
我使用的是Firefox,Chrome& I.E对于这个测试用例,一切都有效。
但我的一些访问者,我不确定他们的I.E版本,当他们点击同意时,服务器会将他们重定向到网站之外。
我认为他们不会通过这项检查
$agreement_check = $_SESSION['agreement'];
$current_path = $_SERVER['REQUEST_URI'];
if($agreement_check!="yes" && (!strstr($current_path,"/agree/")) )
{
if(!header("Location: " . $domainURL . "login"))
{ die("Agreement check expire."); }
}
我在这段代码中做错了什么呢?他们的I.E版本可以是I.E 8或更早版本