BluwAngel Posted January 7, 2012 Share Posted January 7, 2012 hi i need help an idea how can i separate members from admins since i dont know how to create login form i used tutorial ( ) (its session login form only that i made it work other tutorials wre too old or something) how what i want to do is separate members and admins because admin need more rights to do now i have idea but dont know will it work like that what i want to do is create additional row in table named it flag and create 0 (inactive user) 1 (member) 2 (admin) will that work? and how can i create different navigation bars for users and admins? do you recommend that i use different folders to create it or just script based on session and flag? Quote Link to comment Share on other sites More sharing options...
Andy-H Posted January 7, 2012 Share Posted January 7, 2012 Why not just create a dupe of your site login in /admin folder, and an admins table, that way you save the resources that would be used by outputting one set of content for users and another for admins. Quote Link to comment Share on other sites More sharing options...
BluwAngel Posted January 7, 2012 Author Share Posted January 7, 2012 do you have any tutorial or simple explanation im still very new to this especially in login forms still confuses me a lot in it, never dont that before Quote Link to comment Share on other sites More sharing options...
coolpriya073 Posted January 7, 2012 Share Posted January 7, 2012 hi, what you can do is just create a separate folder for members and admin..and separate table for both login, keep it clean for long run member will use the session as session_start(); // If the session vars aren't set, try to set them with a cookie if (!isset($_SESSION['user_id'])) { if (isset($_COOKIE['user_id']) && isset($_COOKIE['username'])) { $_SESSION['user_id'] = $_COOKIE['user_id']; $_SESSION['username'] = $_COOKIE['username']; } } and admin as session_start(); // If the session vars aren't set, try to set them with a cookie if (!isset($_SESSION['admin_id'])) { if (isset($_COOKIE['admin_id']) && isset($_COOKIE['adminuser'])) { $_SESSION['admin_id'] = $_COOKIE['admin_id']; $_SESSION['adminuser'] = $_COOKIE['adminuser']; } } Note: make sure the difference in cookie Quote Link to comment Share on other sites More sharing options...
dharmeshpat Posted January 7, 2012 Share Posted January 7, 2012 wat u can do is u should put one flag column in database which will tell u whether the logged in user is admin or a normal client Once u know which user has logged u u can redirect that user to the respective url And yes it would be better to have different folder for different user type say for admin it would be admin folder and for user it would be user folder 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.