dean7 Posted September 9, 2009 Share Posted September 9, 2009 Hi all, on my website i have userlevels witch people with a certain userlevel can see certain things but on my code it says there is an error <? if($logged[level] ==owner | $logged[level] == head mod | $logged[level] == admin | $logged[level] ==mod) { // More code but not needed i think ?> Im getting a error saying: Parse error: syntax error, unexpected T_STRING in /home/a7502957/public_html/main.php on line 64 Thanks for your help. Quote Link to comment https://forums.phpfreaks.com/topic/173690-solved-user-levels/ Share on other sites More sharing options...
RussellReal Posted September 9, 2009 Share Posted September 9, 2009 'admin' not admin same for all the others Quote Link to comment https://forums.phpfreaks.com/topic/173690-solved-user-levels/#findComment-915594 Share on other sites More sharing options...
Alex Posted September 9, 2009 Share Posted September 9, 2009 if($logged['level'] == 'owner' || $logged['level'] == 'head mod' || $logged['level'] == 'admin' || $logged['level'] == 'mod') Quote Link to comment https://forums.phpfreaks.com/topic/173690-solved-user-levels/#findComment-915596 Share on other sites More sharing options...
KevinM1 Posted September 9, 2009 Share Posted September 9, 2009 In other words strings need quotes around them. And, logical OR is two bars So: if($logged['level'] == 'owner' || $logged['level'] == 'head mod' /* ... */ ) Quote Link to comment https://forums.phpfreaks.com/topic/173690-solved-user-levels/#findComment-915597 Share on other sites More sharing options...
dean7 Posted September 9, 2009 Author Share Posted September 9, 2009 That work thanks Quote Link to comment https://forums.phpfreaks.com/topic/173690-solved-user-levels/#findComment-915602 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.