Home > Backend Development > PHP Tutorial > 这个登录处理代码错了,不知道如何解决

这个登录处理代码错了,不知道如何解决

WBOY
Release: 2016-06-13 12:45:13
Original
815 people have browsed it

这个登录处理代码错了,不知道怎么解决!
这个代码的数据库连接文件没问题,数据库可以正常连接!但不管我怎么登录都一直显示登录页面,没有跳到list.php!一直没办法解决,求解!
session_start();

if(isset($_POST['uid']) && isset($_POST['password']))
{
   $userid=$_POST['uid'];
   $password=$_POST['password'];
include("conn.php");//数据库连接文件
  $query='SELECT * FROM users '."where userid='$userid'"."and password='$password'";
 $result=mysql_query($query);
if($result){
      $_SESSION['who_user']=$userid;
}
}
?>
  include("tou.inc");
?>
if(isset($_SESSION['who_user']))
{
   header("Location: list.php");//确定身份后跳转的用户页面
}else{
   //没有登录
?>
  


                    
                    

          
  • ID:

  •                     
           
  • 密码:

  •                     

                        
      
                注册一个ID
      

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template