登陆时判断用户名、密码是否正确。如果正确就设置SESSION,楼主碰到什么问题?

解决方案 »

  1.   

    去参考一下,
    http://expert.csdn.net/Expert/topic/1852/1852524.xml?temp=.6348993
      

  2.   

    改一下这个
    <?php  
    session_start();
    if($user && $password) {
      $user=trim($user);
      $password=trim($password);
      $db=MySQL_connect("localhost","root");
      MySQL_select_db("xt_data",$db);
      $checkid="select * from xt_user where user=\"".$user."\"";
      $idresu=mysql_query($checkid,$db);
      $row=mysql_fetch_Array($idresu);
      $dwmc=$row[dwmc];
      $dwbm=$row[dwbm];
      if(mysql_error())    {echo "数据库检索失败!";return;}
      if(!mysql_num_rows($idresu)||strcmp($password,mysql_result($idresu,0,"password")) ) {
          mysql_close($db);
          Header("Location:errormsg.php?errmsg=不正确的用户名或密码!");
          reutrn;}
      else {
          Session_Register("current_user");
          $current_user=$user;
          Session_Register("current_user1");
          $current_user1=$dwmc;
          Session_Register("current_user2");
          $current_user2=$dwbm;
          include("index1.php");//登陆成功进入发布页面
      }
    }
    ?>
      

  3.   

    http://expert.csdn.net/Expert/topic/1852/1852524.xml?temp=.6348993