|
Posted by linda on 11/18/06 22:19
OK please bare with me on this, as I don't know all the correct terminology.
I would just like some input if this is the correct way to go about this.
User_Reg Permissions
user_id user_id
name perm
date_of_birth
password
reg_date
I have two tables, one User_Reg and the other Permissions, they are link
through user_id. In Permissions the field perm has a default of 1 (for
registered users), 2 is for administration and 0 being unregistered. What I
would like to know is, is this a good way of going about protecting pages,
using this information in sessions?
So if the person doesn't log in I would create a session when they visit the
site of 0, this would only allow them to view certain pages, when they log
in a session of 1 and their user name, and if admin logs in this would then
be 2 and user name.
I'm new to php and mysql so I'd be very grateful about how is the best way
of going about this.
The reason I have gone with permission levels is that later I'd like to work
on a menu later, that displays links according to permission level.
Many thanks in advance,
Linda
[Back to original message]
|