好的,所以我有maconbeercompany.com,它有一个年龄验证重定向。它适用于IE,Chrome,Safari和Firefox。唯一的问题是我无法使它与移动设备兼容。当在iPhone或Android上时,除非点击“否”,否则我不能离开年龄验证页面。我希望用户能够点击“是”并访问啤酒公司的网站。以下是代码。我究竟做错了什么?重定向页面在移动时不重定向
<?php
// This code, including the enclosing ?php tags, will require age verification for this page if included at the beginning of the associated HTML/PHP file.
session_start();
if (!isset($_SESSION['age_verified']) || $_SESSION['age_verified'] != true)
{
// Direct them to the age verification page
$redirect_url = urlencode("http://" . $_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF']);
header('Location: http://maconbeercompany.com/age-verification.php?redirect=' . $redirect_url);
}
?>
感谢您的帮助!
你想将其存储在会话??如果你为什么?你不用做更多的验证,只重定向...为什么不使用链接''? – Tiago
你有使用移动设备来测试这个,启用cookies吗? – Lissy
@Tiago他可能希望它记住用户的回答,所以他们不必验证他们的年龄 – Lissy