Session 美元交易日[';变量';]韩元';不能取消或改变

Session 美元交易日[';变量';]韩元';不能取消或改变,session,login,usertype,Session,Login,Usertype,没有联系到其他人。。为什么?显然,我也更愿意选择TRUE或FALSE来更改这一行 $UserType = $row['UserType']; $_SESSION['UserID'] = $row['UserID']; //unset($_SESSION['UserType']); $_SESSION['UserType'] = $UserType; //unset($_SESSION['Dashboard']); if ($UserType == 'read' OR 'edit' OR 'a

没有联系到其他人。。为什么?显然,我也更愿意选择TRUE或FALSE来更改这一行

$UserType = $row['UserType'];

$_SESSION['UserID'] = $row['UserID'];

//unset($_SESSION['UserType']);
$_SESSION['UserType'] = $UserType;
//unset($_SESSION['Dashboard']);
if ($UserType == 'read' OR 'edit' OR 'admin') {$_SESSION['Dashboard'] = 'YES';} 
else {$_SESSION['Dashboard']='NO';}

if ($_SESSION['Dashboard'] == 'YES') { ..... }

换行

$UserType = $row['UserType'];

$_SESSION['UserID'] = $row['UserID'];

//unset($_SESSION['UserType']);
$_SESSION['UserType'] = $UserType;
//unset($_SESSION['Dashboard']);
if ($UserType == 'read' OR 'edit' OR 'admin') {$_SESSION['Dashboard'] = 'YES';} 
else {$_SESSION['Dashboard']='NO';}

if ($_SESSION['Dashboard'] == 'YES') { ..... }


你的if语句不正确。当前代码基本上是比较$UserType=='ready'或'edit'不是空的,或者admin不是空的

你想要:


if($UserType=='read'或$UserType=='edit'或$UserType=='admin')

您的if语句不正确。当前代码基本上是比较$UserType=='ready'或'edit'不是空的,或者admin不是空的

你想要:


如果($UserType=='read'或$UserType=='edit'或$UserType=='admin'),

请运行您的检查

if ($UserType == 'read' OR $UserType =='edit' OR $UserType =='admin') {$_SESSION['Dashboard'] = 'YES';} 

把你的支票办好

if ($UserType == 'read' OR $UserType =='edit' OR $UserType =='admin') {$_SESSION['Dashboard'] = 'YES';} 

哇,你是我的救世主——我总是忘记基本原理!!非常感谢Abderrahim欢迎兄弟,请确定我的答案作为您问题的解决方案我会的-但我还要再等7分钟-谢谢慢慢来兄弟;)哇,你是我的救世主——我总是忘记基本原理!!非常感谢Abderrahim欢迎兄弟,请确定我的答案作为您问题的解决方案我会的-但我还要再等7分钟-谢谢慢慢来兄弟;)是的-我实际上会做一些东西,将不同的用户类型分配给不同的权限也:):)-谢谢:)是的-我实际上会做一些东西,将不同的用户类型分配给不同的权限也:):)-谢谢:)耶-基本语法:(::(:::(:::(:::(:::(:::(:::(:::(:)基本语法(