语法错误,意外T_BOOLEAN_OR

时间:2016-06-23 10:14:16

标签: php session

帮我解决这个问题......坚持了几个小时

if(!isset($_SESSION['username']) || $_SESSION['user_type'] !='admin')||(!isset($_SESSION['username']) || $_SESSION['user_type'] !='user'){ // if session variable "username" does not exist.
header("location:index.php?msg=Sila%20log%20masuk%20untuk%20mengakses&type=error");

}

当我以管理员身份登录时,它正常运行。但是当我以用户身份登录时,它会一直显示此错误

  

解析错误:语法错误,第4行的C:\ xampp \ htdocs \ cubaan \ init.php中的意外T_BOOLEAN_OR

你能帮助我吗

1 个答案:

答案 0 :(得分:0)

试试吧 <?php if((!isset($_SESSION['username']) || $_SESSION['user_type'] !='admin')||(!isset($_SESSION['username']) || $_SESSION['user_type'] !='user')){ // if session variable "username" does not exist. } header("location:index.php?msg=Sila%20log%20masuk%20untuk%20mengakses&type=error"); ?>