When doing a login, it is necessary to verify the correctness of the account and password by using PHP after the asynchronous check.
PHP Check account password:
Public functionLogin () {if(!is_post) {Echo"Page does not exist";$this->redirect (' index '); die();}; $username= I (' Post.username '); $pwd= I (' Post.password ', ' ', ' MD5 '); $code= I (' Post.code '); $obj=New\think\verify (); if(!$obj->check ($code)){ $this->error (' captcha error ')); }; //verify your account and password $where=Array( ' Account ' =$username ); $result= M (' admin ')->where ($where),find (); if(!$result||$result[' password ']! =$pwd){ $this->error (' Account or password error ')); }; if($user[' Lock ']){ $this->error (' account is locked '); }; $data=Array( ' id ' =$result[' ID '], ' logintime ' = Time(), ' loginip ' =get_client_ip ()); M (' admin ')->save ($data); //Save SessionSession (' UID ',$result[' ID ']); Session (' UID ',$result[' Account ']); Session (' Logintime ',Date(' Y-m-d h:i ',$result[' Logintime '])); Session (' Loginip ',$result[' Loginip ']); $this->redirect ('/admin/index ', ' ', 2, ' page is jumping in ... '));}
Question and Answer item---PHP Verification after an asynchronous check of the account password