thinkphp 手机号和用户名同时登录

前端之家收集整理的这篇文章主要介绍了thinkphp 手机号和用户名同时登录前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。

话不多说,请看代码

where("login_id='{$username}' OR phone='{$username}'")->find(); if (!empty($res) && $res['password']==md5($password)) { $status=1; //用户名正确,密码正确。 }elseif(!empty($res) && $res['password']!==md5($password)){ $status=2; //用户名正确,密码不正确。 }elseif(empty($res)){ $status=3; //用户名不存在。 } $this->ajaxReturn($status); exit(); } $mobile = parent::isMobile(); if($mobile=="true"){ $this->display(Wap_Login); }else{ $this->display(Login); } }

以上就是本文的全部内容,希望本文的内容对大家的学习或者工作能带来一定的帮助,同时也希望多多支持编程之家!

原文链接:https://www.f2er.com/thinkphp/18086.html

猜你在找的ThinkPHP相关文章