Jump to content

Recommended Posts

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

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.