ChompGator Posted December 9, 2007 Share Posted December 9, 2007 Im trying to set up a certain type of login - which Ive never done before - When - Employee's login - they see "Certain links" When Managers Login - they see the links the employee's see, plus additional "managers links" When Vice-Presidents Login - they see all the links employee's see, managers see, and additional "vp links" So what I did was set up a login, with 3 levels of access, when a user puts their username then password in - they then select from a drop down menu if they are level 1 access, level 2 access, or level 3 access. Then they hit submit, the information gets verified in a database(username, password, access level) ... Problem is, as I know how to direct the login to whatever page is applicable for their access level, but I dont understand how I can I guess start the session? so that each user if they want can set up their profile, or whatever. So basically like all employees would see the same links, but in a sense they wouldn't be the same links because each user can customize his/her own area. Anyone have any good advice or know of any tutorials for doing this sort of thing? Quote Link to comment Share on other sites More sharing options...
revraz Posted December 9, 2007 Share Posted December 9, 2007 I wouldn't even give them the choice of what level to pick, you should set that level in the Database with their user record. When they login, you check that status, and based on that you can do what you like. Use session_start() at the top of everypage, when they login set their leve like $_SESSION['level']=2 then whatever page they can see, you check to see if they are that level, and if not, redirect them away to a different page. You can use less than or greater than formulas to determine if they can see certain pages if it allows multiple levels to view. Quote Link to comment Share on other sites More sharing options...
ChompGator Posted December 10, 2007 Author Share Posted December 10, 2007 Thank you for the response, it helped, I actually did a test, and it worked, but I screwed up the code, so Im having to re-do it! - Thanks, Ill post again in here if I run into any trouble 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.