User Levels

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
Richard H
Forum Newbie
Posts: 1
Joined: Sun Jun 16, 2002 8:19 am

User Levels

Post by Richard H »

Hello Everyone

I'm a new member and my first question (probably of many!) is what would be the best way to set up a login script using MySQL tables, sessions, and most importantly user levels?

I can set up the basic login script but it is the user levels part that I am unable to fully grasp. What I hope to do is define properties for each page in my website in a table (easy enough). Properties would include user levels. Then if a user is not logged in, or if they are not set to the correct level they will be unable to view the page.

The script is going to be used as part of a database driven website management script. Would I correctly assume that user level would be defined in the header of each page along with the login script?

Any comments or input are most appreciated.

Regards - Richard H
Zmodem
Forum Commoner
Posts: 84
Joined: Thu Apr 18, 2002 3:59 pm

Post by Zmodem »

Sounds like you already know the answer ;)

I would create a variable called $user_level, and store that, in the PHP session.

When Johnny Q Websurfer visits your site, simply check the $user_level assigned to Johnny, against the allowed user levels for that page.
Post Reply