Kay1021 Posted May 25, 2009 Share Posted May 25, 2009 Hi I was wondering if anyone knew of any site that could help me. I am looking to create a secure site where at the beginning the user is prompted to enter a username and password there is 1 admin and then say 8 users. When each user has entered the correct information they are taken to a page specifically for them...and they are not allowed access into any of the other 7 users' pages. However the one admin can view all 8 pages. I'm just wondering if anyone could guide me. Even if you've got a tutorial that does this sort thing or how i could modify one....i'm just kinda stuck. Thanks Link to comment https://forums.phpfreaks.com/topic/159586-user-login-directed-to-specific-page/ Share on other sites More sharing options...
Daniel0 Posted May 25, 2009 Share Posted May 25, 2009 So the pages and users are linked using a one-to-one relationship. You just do this: if ($user['is_admin'] || $page['user_id'] == $user['user_id']) { echo "what's up?"; } else { echo 'gtfo'; } Assuming your page comes from the database, your page table would have a field called user_id which references a user in the users table. Link to comment https://forums.phpfreaks.com/topic/159586-user-login-directed-to-specific-page/#findComment-841743 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.