代码发布者QQ:467477957
PHP登录:
$res=mysql_query("SELECT * FROM think_member WHERE username = '$_POST[m]' and password = '$_POST[password]' or tel = '$_POST[m]' and password = '$_POST[password]' limit 1");
if ($res2 = mysql_fetch_array($res)) {
import('ORG.Util.Session');
Session::set('m',$_POST['m']);
$this->success('登录成功!','__ROOT__/');
}
else{
$this->error('用户名或密码错误!');
}ThinkPHP 登录:$res = $Member->where("tel='$_POST[m]' and password='$_POST[password]' or username = '$_POST[m]' and password = '$_POST[password]'")->find();//此处$res代表的是两个条件的值
if ($res){
import('ORG.Util.Session');
Session::set('m',$_POST['m']);
$this->success('登录成功!','__ROOT__/');
}
else{
$this->error('用户名或密码错误!');
} 