解决方案 »

  1.   

    $sql="select * from pre_common_member where username='$username'";
      

  2.   

    弹窗乱码是因为你的程序文件不是 utf-8 的
    错误信息是因为你在 
    header('Location:ClassWeb.php'); 
    前有输出
    echo"<script>alert('用户名或密码错误!')</script>";
      

  3.   

    echo"<script>alert('用户名或密码错误!')</script>";
      header('Location:ClassWeb.php');exit();
    改成
    echo"<script>alert('用户名或密码错误!');location.href = 'ClassWeb.php';</script>";
      

  4.   

    恩,文件格式是  utf-8-无BOM 格式的,可是不要这个格式,session_start()这个函数就会报错啊,错误为Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent
    7楼的 我试过了,也不行,还是会报错和乱码的,而且不管我输入的账户和密码是什么,都显示用户名或者密码错误!!
      

  5.   

    我找到输入错误的原因了。是因为$row['password']==md5($password) 这里出错了,我连的是Discuz里的用户表,估计他用的不是MD5加密的。乱码还是没解决
      

  6.   

    在页面的PHP程序前加一句HTML语句:<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />