Internet explorer php登录页面中的internet explorer出现问题

Internet explorer php登录页面中的internet explorer出现问题,internet-explorer,http-headers,Internet Explorer,Http Headers,我有一个网页,通过检查用户的用户名和密码,然后将其重定向到管理员页面,来登录用户 但它不会重定向到internet explorer中的管理页面。我正在使用头函数进行重定向 这是登录页面的代码 <?php include("session.php"); //include("dbconnect.php"); $_SESSION['userid']=$row['id']; $_SESSION['ses_username']=$row['email']; $msg=$_GET['msg'];

我有一个网页,通过检查用户的用户名和密码,然后将其重定向到管理员页面,来登录用户

但它不会重定向到internet explorer中的管理页面。我正在使用头函数进行重定向

这是登录页面的代码

<?php
include("session.php");
//include("dbconnect.php");
$_SESSION['userid']=$row['id'];
$_SESSION['ses_username']=$row['email'];
$msg=$_GET['msg'];
    if(isset($_POST['sub']) == "sub")
    {
                $user=$_POST['username']; 
                $pwd=$_POST['password']; 
                echo $sqlSel="select * from users where email='".$user."' and password='".$pwd."'"; 
                $res=mysql_query($sqlSel) or die(mysql_error());
                if (mysql_num_rows($res)==0){
                $msg = "Please input Correct Credentials";
        header('location: index.php?msg='.urlencode($msg));
        die();
    }
    else
    {
        $row=mysql_fetch_array($res);
        $_SESSION['userid']=$row['id'];
        $_SESSION['ses_username']=$row['email'];
        echo $_SESSION['name']=$row['first_name']; 
        $_SESSION["loggedIn"]=true;
        header('location: admin.php?name='.urlencode($row['first_name']));
        }
    }   
?>

<div id="myaccountlogin">
<form name="form3" method="post" action="">
    <table width="260" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="4%" height="80">&nbsp;</td>
        <td width="11%">&nbsp;</td>
        <td width="10%">&nbsp;</td>
        <td width="18%">&nbsp;</td>
        <td width="12%">&nbsp;</td>
        <td width="5%">&nbsp;</td>
        <td width="3%">&nbsp;</td>
        <td width="30%">&nbsp;</td>
        <td width="3%">&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td colspan="3" class="name" align="center">User Name:</td>
        <td colspan="3">
            <input name="username" type="text" id="username" size="15" /></td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td colspan="3">&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td colspan="3" class="name" align="center">Password:</td>
        <td colspan="3">
          <label>
            <input name="password" type="password" id="password" size="15" />
            </label>
                </td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td colspan="4" align="right" class="forgotton">Forgotten Password</td>
        <td>&nbsp;</td>
      </tr>
            <tr><td colspan="9">&nbsp;</td></tr>

      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td colspan="5" align="center" style="padding-right: 40px;"><input type="image" src="images/signin.png" name="sub" value="sub" width="70" height="25" /></td>
        <td>&nbsp;</td>
      </tr>
      <tr>
        <td>&nbsp;</td>
        <td>&nbsp;</td>
        <td colspan="6" class="newreg"><a href="registration.php">New Registration</a> | <a href="registration.php"> Sign up </a></td>
        <td colspan="3">&nbsp;</td>
        <td>&nbsp;</td>
      </tr>
    </table>
    </form>
  </div>

如果您正在使用cookies,则必须设置cookies的完全权限才能访问IE中的内容。

这可以通过“开始”菜单附近的土星(行星)符号识别,但在您的右侧,请单击它并设置权限@此时您将能够登录。

更新:

我试过你的代码,但我能找到的是,你需要设置$\u POST['sub'],但你没有定义一个名为“sub”的输入类型=“hidden”,你所拥有的只是一个名为“sub”的输入类型=“image”,看起来IE并没有将其作为POST变量发送。因此,在IE中,PHP从不接收$_POST['sub'],这就是它不重定向的原因

我仍然建议使用正确的大小写和起始斜杠作为位置:header。祝你好运

原始答案:

不确定,但您是否尝试过:

header('Location: /index.php?msg='.urlencode($msg));

请下次使用代码格式(选择代码并按
{}
-sympol)您的代码包含SQL注入错误!真的很危险!不要在真正的互联网服务器上使用该代码!如果PHP已经输出了其他内容,则不能发送头。也许是这样?您的PHP警告/通知/错误是否向您显示消息“Headers ready sent”?INTERNET EXPLORER与PHP或mysql无关?wtfIm将对此进行投票,纯粹是因为IE是一个令人讨厌的东西,而且它因区分大小写而引发骚动的机会相当不错。尝试了此解决方案,但不起作用。值以表单形式发布,但重定向回同一页面。在mozilla、Google crome中工作正常。我试过这一个cookies是在设置中启用的。