I have a region of a web page that is visible only to logged in users with the access level 'level1' - I want to amend this code and add a second user access level 'level2'.
So basically I want users with access 'level1' and 'level2' to see 'X' content.
Here's the code....
<?php if (isset($_SESSION['MM_UserGroup']) && $_SESSION['MM_UserGroup']=='level1'){ ?>
'content here'
<?php } ?>
I tried amending the code to the following but without luck:
<?php if (isset($_SESSION['MM_UserGroup']) && $_SESSION['MM_UserGroup']=='level1,level2'){ ?>
Any help would be appreciated!
>$_SESSION['MM_UserGroup']=='level1,level2'
Are you trying to test for users that are in a group called 'level1,level2' ? Or testing if the user is in either level1, or level2? If the latter, then obviously your code won't work. You would need to check for either condition.
<?php if (isset($_SESSION['MM_UserGroup']) && ($_SESSION['MM_UserGroup']=='level1') || $_SESSION['MM_UserGroup']=='level2')){ ?>
North America
Europe, Middle East and Africa
Asia Pacific