Hi everyone!
So i have been trying to figure this out all day.
what i am trying to do is allow different users different access to different parts of the backend of my site.
I have a users table in my DB that stores - Username-password-userlevel ( which stores a number based from the level row below)
i also have a table called user_level that stores - Level (1,2,3, ect) Title(admin, Mod, Reg, guest, ect) then i have Access_news, Access_articles (which stores a 1 for allowed 0 for not)
so if admin logs in he has access to all pages (as all are set to 1 in the user_level table)
i assume there needs to be a code on the top of each page that would read something like this
If user is accessing the news page (check in users table under User_level for a number) then check user_level table and allow access to all (access_x page) allowed...
make sense ?
i am lost on how i would write it.. ive created just about all the other pages to the backend of the site but i cant figure this one out, hehe.
Table Example:
Users Table
ID - Username - User_level
1 - Admin - 5
2 - Jon - 3
3 - bob - 1
User_online table
Level - Title - Access_Articles - Access_news - Access_images
5 - Admin - 1 - 1 - 1
3 - mod - 1 - 1 - 0
1 - reg - 1 - 0 - 0
Any help would be great.
Thanks