mysty Posted January 9, 2009 Share Posted January 9, 2009 I have attached the code I insert to allow me to restrict access to the table between the code. In my user database I assign the level of access. That is, I assign a 9 to the admin and an 8 to everyone else. What I would like to be able to do is add some more access levels (ie 9, 8, 7, 6, etc) and then be able to restrict access to one of the tables to more than one access level. So, the code now allows only one access level, and I want to be able to allow more than one. How would the code need to be changed? <code> <?php if(isset($_SESSION['MM_UserGroup'])&& $_SESSION['MM_UserGroup']=='9'){?> TABLE In Webpage <?php } ?> </code> Quote Link to comment Share on other sites More sharing options...
bluesoul Posted January 9, 2009 Share Posted January 9, 2009 <?php if(isset($_SESSION['MM_UserGroup'])&& ($_SESSION['MM_UserGroup']=='9' || $_SESSION['MM_UserGroup']=='8')){?> Quote Link to comment Share on other sites More sharing options...
mysty Posted January 9, 2009 Author Share Posted January 9, 2009 ??? Quote Link to comment Share on other sites More sharing options...
mysty Posted January 10, 2009 Author Share Posted January 10, 2009 anybody? Quote Link to comment Share on other sites More sharing options...
xtopolis Posted January 10, 2009 Share Posted January 10, 2009 $allowedLevels = array(5,6,7); if(isset($_SESSION['MM_UserGroup']) && in_array($_SESSION['MM_UserGroup'],$allowedLevels)){?> TABLE In Webpage <?php } ?> Quote Link to comment 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.