>  기사  >  백엔드 개발  >  thinkphp会员登录有关问题

thinkphp会员登录有关问题

WBOY
WBOY원래의
2016-06-13 12:40:27972검색

thinkphp会员登录问题

<?php<br />
session_start();<br />
header('Content-Type:text/html; charset=utf-8');<br />
class AdminAction extends Action{<br />
      public function index(){<br />
	  if(isset($_POST['username'])){<br />
	        if(isset($_POST['username'])&&isset($_POST['password'])){<br />
			    $db=M();<br />
				$select=$db->query("select * from developers where username=".$POST['username']." and password=".$_POST['password']."");<br />
				if($select){<br />
				    $_SESSION['admin']=$_POST['username'];<br />
					$this->redirect('Index/index','',2,'用户'.$_POST['username'].'登录成功!');<br />
                 }else{<br />
					$this->redirect('Index/index','',2,'用户名或者密码不正确');<br />
					}<br />
				}else{<br />
				    $this->redirect('Index/index','',2,'用户名或密码不能为空!');<br />
					}<br />
					}<br />
					$this->display();<br />
					}<br />
	<br />
    <br />
<br />
	}<br />
	?>

这是AdminAction代码,不知道怎么回事,不管输入什么或者不输人它都提示用户名或者密码不正确,为什么呢?哪的问题?

성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.