topflight Posted October 10, 2008 Share Posted October 10, 2008 Hi all I am in the process of creating a log in system and I would like some feedback,suggestions as I am new to php. I will be using sessions, however I will have different setting (i.e 1=user 2=admin 3=hm and etc..) and I want to show certain things in the login script base on their permissions. Suggestions are welcome. Thanks in Advanced Quote Link to comment https://forums.phpfreaks.com/topic/127923-creating-a-loging-script/ Share on other sites More sharing options...
adamjones Posted October 10, 2008 Share Posted October 10, 2008 In your users table, add a column called 'access', or 'rank', or something, and register it in your session, eg: session_register("access"); Then, in your access column, just add different levels to users. If you want to block access to a certain page, if the user level is below the required, add this to the header; <? session_start(); if(!session_is_registered(access)){ header("location:index.php"); } if ($access < 2) { header("location:denied.php"); } ?> This will send all users with an access level of below 2 to 'denied.php'. Hope that helps. Quote Link to comment https://forums.phpfreaks.com/topic/127923-creating-a-loging-script/#findComment-662347 Share on other sites More sharing options...
topflight Posted October 11, 2008 Author Share Posted October 11, 2008 Well currently I have it set up so that if you are a bm(board member) you will get a 1 if you are not you will get a 0. That's how all the other permissions are set up to. If that ok you think? Quote Link to comment https://forums.phpfreaks.com/topic/127923-creating-a-loging-script/#findComment-662510 Share on other sites More sharing options...
Maq Posted October 11, 2008 Share Posted October 11, 2008 Well currently I have it set up so that if you are a bm(board member) you will get a 1 if you are not you will get a 0. That's how all the other permissions are set up to. If that ok you think? It's whatever you want. Show us your code and explain what you're trying to do so we can help you. Quote Link to comment https://forums.phpfreaks.com/topic/127923-creating-a-loging-script/#findComment-662542 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.