Lz是不是用AJAX登录的,如果你是用JS获取输入框的值,FIREFOX下,比较严格,要设置ID才能得到值,而IE下,只有个name就可以,
我刚开始换FIREFOX也出现用户名错误问题,我的是这个原因,不知道LZ是不是因为这样

解决方案 »

  1.   


    楼主不贴代码,要我们猜,很难猜出问题所在,你把IE的设置设置为默认试一下,可能是Cookies的问题,反正楼主贴代码好搞一些。
      

  2.   

    从你的描述,firefox能登录,ie不能登,php程序肯定没问题。
    就看php以外比如js之类的传值的不同了。
    其他的没法分析了。
      

  3.   

    httpwatch抓一下包吧,看看提交的东西是不是一样。
      

  4.   

    哈哈,TRIM一下,然后,print_r($_REQUEST)看看用户名密码,提交得是否一样
      

  5.   

    谢谢大家的热心帮助,源码如下。环境是Redhat ES5 + Apache + PHP +Mysql
    登录页面<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <LINK REL=stylesheet HREF="inc/my.css" TYPE="text/css">
    <title>登录窗口</title>
    </head>
    <body>
    <?php
    include 'inc/header.php';
    ?>
    <p>&nbsp;</p><p>&nbsp;</p>
    <form name="form1" method="post" action="loginprocess.php">
      <table border="0" align="center">
        <tr>
          <td><div align="right">用户名</div></td>
          <td><input name="username" type="text" size="20" maxlength="20"></td>
        </tr>
        <tr>
          <td><div align="right">密码</div></td>
          <td><input name="password" type="password" size="20" maxlength="20"></td>
        </tr>
        <tr>
          <td><div align="right">
            <input type="submit" name="Submit" value="提交">
          </div></td>
          <td>
            <div align="right">
              <input type="Reset" name="Reset" value="取消">
            </div></td>
        </tr>
      </table>
    </form>
    <p>&nbsp;</p>
    <p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p><p>&nbsp;</p>
    <?php
    include "inc/tailer.php";
    ?>
    </body>
    </html>处理页面<?php
    include 'inc/conn.php';
    include 'inc/para.php';
    $username = $_REQUEST[username];
    $password = $_REQUEST[password];
    $username = mysql_real_escape_string($username);
    $password = mysql_real_escape_string($password);
    $result=mysql_query("select id, pass,realname from user where username='" . $username . "' and pass= PASSWORD('" . $password . "');") 
    or die("Can't Query:". mysql_error());
    if($row = mysql_fetch_array($result)){
    //valid user processing
    $id=$row[0];
    //set cookie
    $time=date("Y-m-d H:i:s",time());
    $cookie=md5($row[1] . $time);
    mysql_query("update user set lastlogintime='". $time . "' where id=" . $id .";") or die("Cannot Update lastlogintime:". mysql_error());
    setcookie("Id",$id,time()+1800);
    setcookie("Sno",$cookie,time()+1800);
    setcookie("RealName",$row[2]);
    mysql_free_result($result);
    //redirect to upload 
    header("Location:http://" . $WebAddress . $WebDir ."xxxx.php");
    } else {
    mysql_free_result($result);
    //invalid user processing
    header("Location:http://" . $WebAddress . $WebDir ."loginerr.php");
    }?>
      

  6.   

    我加了些测试代码,发现问题不是出在loginprocess.php上。出在登录成功跳转的xxx.php中的校验用户Cookie的部分。代码如下:
    $id=$_COOKIE[Id];
    $sno=$_COOKIE[Sno];
    在IE终端提交的数据中,得不到这两个值,而FireFox提交的数据中,就可以得到。
      

  7.   

    修改为
    $id=$_COOKIE["Id"];
    $sno=$_COOKIE["Sno"]; 
    还是不行,也就是在IE中Cookie不能用了,怎么回事?
    换了一台客户机器,同样的问题,应排除IE的问题。是不是Apache的问题?
      

  8.   

    Notice: Use of undefined constant username - assumed 'username' in C:\www\loginprocess.php on line 4Notice: Use of undefined constant password - assumed 'password' in C:\www\loginprocess.php on line 5
    我在IE下有这样的错误???????
      

  9.   

    是不是你IE的设置有问题?
    用session试一下吧。
      

  10.   

    Firefox会强行记录session,会不会是这个问题。
      

  11.   


    如果Firefox行,而IE不行,那么就是浏览器或代码兼容的问题.楼主检查一下IE的设置,特别是安全设置,或者在里面 ,ECHO一下那几个COOKIES变量,看看有没有输出,可能是浏览器安全设置的问题.
      

  12.   

    我已经把我的站点加到可信站点中去了,还是不行。经查internet临时目录下,根本没有生成cookie。
    问题应是出在setcookie()函数中。
    谢谢大家。
    我自己的拙见,IE自身的问题基本可排除,因为我用同样的IE访问同样部署在Redhat8上的相同代码是没问题的。
    我现在准备下载一下Apache的最新代码,重新编译一下,不用REDHAT自带的了。请大家继续帮我分析原因。
      

  13.   

    = =!
    Zend用惯了回来看PHP代码快看不懂了