0

好的,所以我有 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 );
} 
?>

谢谢你的帮助!

4

2 回答 2

0

有时标头在会话中效果不佳,因此我建议您尝试:

$redirect_url = urlencode("http://" . $_SERVER['SERVER_NAME'] . $_SERVER['PHP_SELF'] );

echo "<meta http-equiv=refresh content='0; url=http://maconbeercompany.com/age-verification.php?redirect=". $redirect_url."'>";
于 2013-08-19T15:04:56.743 回答
0
"; echo "window.open(``位置:http://maconbeercompany.com/age-verification.php?redirect=` . $redirect_url `, `_parent`, `)"; echo " "; } ?>
于 2013-08-19T15:33:20.750 回答