Please help over msn - mysql & php

goldy30

New Member
Messages
60
Reaction score
0
Points
0
I'm trying to set up a login where it allows two different access levels. members login will display a members area link... admin login displays both members and admin area links. Also once logged in a wecome message appears and echos the users email.

It's half done but I've got problems and it's gotten a bit advanced for me to figure out. My msn is airbrushkits@live.com I can send you files for you to look at and I can upload to check.

so I need help desperately asap, I've gone ahead and had help working out things too advanced for me and it's not finished. Due tomorrow. Help!
 

mfurqanabid

New Member
Messages
37
Reaction score
0
Points
0
create a field in database name user_priv (int 1) and use 0 for users and 1 for admin.

Create 2 session

if user is admin than

$_SESSION['is_admin'] = 1;
$_SESSION['is_member'] = 1;

and if user than
$_SESSION['is_admin'] = 0;
$_SESSION['is_member'] = 1;

retrieve these session into admin and members area and check that he have rights to access these pages or not......
 

xPlozion

New Member
Messages
868
Reaction score
1
Points
0
what you would obviously have to do is add a new row into the user database called access or something similar. have admin's one level, regular users another level, etc...

then what i do is have just the username and hashed password stored in cookies, then at the top of every page, i check those credentials against the database, then create unique variables to control the rest of it.

for instance, if those credentials matched, i would create a new variable called $logged_in or something similar, and if they were an admin, make one called $is_admin, or $access_lvl = the level stored in the db. if the level is == 1 for instance, they would be a regular member, 2 would be a mod (if you've got any), 3 an admin, etc...

then for the parts that only an admin should see make it if ($is_admin == TRUE) or if ($access_lvl == 3), show what the admin should see.
 
Last edited:
Top