PHP detects whether the account password matches:
Recommended:php server
HTML code:
PHP code:
where($where)->select(); if($users){ $_SESSION['id']=$users['id']; $_SESSION['user_shell']=md5($users['username'].$users['password']); $this->redirect('Index/index'); }else{ echo ""; } }else{ $this->display(); } } public function lusername(){ $where['username']=I('username'); $users=M('users')->where($where)->select(); if(!$users){ echo "用户名错误"; } } public function lpassword(){ $where['password']=I('password'); $users=M('users')->where($where)->select(); if(!$users){ echo "密码错误"; } } }
The above is the detailed content of PHP detects whether account password matches. For more information, please follow other related articles on the PHP Chinese website!