jzdexta Posted April 6, 2006 Share Posted April 6, 2006 Was wondering if i could create dynamic menus based in user logn details?This is supposed to be an intra-net based site where members of the organisation can log their data periodically from any machine within the organisation though with hopes of extendng it to internet logging of data.Anyone with ideas of what to do for the time being the menu is staticThanx in advance Quote Link to comment Share on other sites More sharing options...
bbaker Posted April 6, 2006 Share Posted April 6, 2006 you could base the menu's on user level (i assume this is why you want different menus). you could set up your database menu sort of like this:menu_title | menu_url | user_level---------------------------------------------- Home | index.php | 0 Admin | admin.php | 1 Contact | contact.php | 0where level 0 is basically anyone & level 1 is admin level (obviously)You'd need a level field in your user database as well. When the user logins in, check that user's level & set a session variable for the user's level. Then when you get the menu make sure your query selects the info based on the user level.mysql_query("SELECT * FROM menu_table WHERE user_level = '".$_SESSION['user_level']."' OR user_level = '0'") or die(mysql_error());This query will always show menu items where user_level is 0 & will ONLY show level 1 items if the session level is 1.Hope this helps 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.