The thinkphp mobile phone number and user name are both logged on, thinkphp login Login? /A> Please try again later.
For more information, see the code:
// When registering, the user name cannot be a pure number, so that the user name of one person cannot be the same as the mobile phone number of another person. public function Login () {if (IS_AJAX) {$ username = I ('Param. username'); // var_dump ($ username); $ password = I ('Param. password '); $ user = M ("cuser "); $ res = $ user-> where ("login_id = '{$ username}' OR phone = '{$ username}'")-> find (); if (! Empty ($ res) & $ res ['Password'] = md5 ($ password) {$ status = 1; // the user name is correct and the password is correct. } Elseif (! Empty ($ res) & $ res ['Password']! = Md5 ($ password) {$ status = 2; // the user name is correct and the password is incorrect. } Elseif (empty ($ res) {$ status = 3; // the user name does not exist. } $ This-> ajaxReturn ($ status); exit () ;}$ mobile = parent: isMobile (); if ($ mobile = "true ") {$ this-> display (Wap_Login);} else {$ this-> display (Login );}}
The above is all the content of this article. I hope this article will help you in your study or work. I also hope to provide more support to the customer's home!