Rederict仅适用于特定的浏览器


Rederict works only in specefic browsers

以下代码在Chrome中正确地进行了重新定义,但在IE中没有。…为什么?

(...)
$x = mysql_real_escape_string($_POST['x']);
$x = mysql_real_escape_string($_POST['x']);
$x = mysql_real_escape_string($_POST['x']);
$x = mysql_real_escape_string($_POST['x']);
$MomentEvent = mysql_real_escape_string($_POST['MomentEvent']);
     {
    $registerquery = mysql_query("INSERT INTO users_event (x, x, x, x, x, MomentEvent) VALUES('".$x."', '".$_SESSION ['x']."', '".$x."', '".$x."', '".$x."', '".$confirm_code=md5(uniqid (rand())). "'); ");
    if($registerquery)
    {
        echo "<h1>XXXX</h1>";
        echo "<p>XXXXX</p>";          
        echo "<meta http-equiv='refresh' content='0;show2.php?MomentEvent=<?php echo $MomentEvent ?>' />";
}
    else
    {
        echo "<h1>Error</h1>";
        echo "<p>Sorry, your registration failed. Please go back and try again.</p>";    
    }
(...)

我认为您最好使用header()函数来发送用于重定向的适当HTTP标头,如下所示:

header( "show2.php?MomentEvent=" . $MomentEvent );

如果你想坚持你目前使用的方法,你需要包括URL=属性,所以它看起来像这样:

<meta http-equiv='refresh' content='0;URL=show2.php?MomentEvent=<?php echo $MomentEvent; ?>' />