Heim  >  Artikel  >  Backend-Entwicklung  >  thinkphp会员登录有关问题

thinkphp会员登录有关问题

WBOY
WBOYOriginal
2016-06-13 11:31:29840Durchsuche

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代码,不知道怎么回事,不管输入什么或者不输人它都提示用户名或者密码不正确,为什么呢?哪的问题?

Stellungnahme:
Der Inhalt dieses Artikels wird freiwillig von Internetnutzern beigesteuert und das Urheberrecht liegt beim ursprünglichen Autor. Diese Website übernimmt keine entsprechende rechtliche Verantwortung. Wenn Sie Inhalte finden, bei denen der Verdacht eines Plagiats oder einer Rechtsverletzung besteht, wenden Sie sich bitte an admin@php.cn