时间:2021-07-01 10:21:17 帮助过:9人阅读
$session['userInfo']='用户中心';
query("select authority from setting_user where number='".$number."' and password='".$pass."'");
$r=$q->fetch_array(MYSQLI_USE_RESULT);
(int)$authority=$r['authority'];//权限分配
if($q->num_rows>0){
//分配显示名
$qShow=$m->query("select * from setting_display where user='".$number."' order by id desc limit 1");
$rShow=$qShow->fetch_array(MYSQLI_USE_RESULT);{
$_SESSION['receiving']=$rShow['receiving']?$rShow['receiving']:NULL;
$_SESSION['po']=$rShow['po']?$rShow['po']:NULL;
// 很多session 在这里
if($_POST['remeberMe']){
setcookie("u",$number,time()+3600);
setcookie("p",$pass,time()+3600);
}
}
$_SESSION['auth']=$number;
switch($authority){
case 1:echo "";$_SESSION['admin']=1;break;
default:echo "";$_SESSION['admin']=NULL;break;
}
}
else{
echo "";
}
}
?>