Jump to content

Recommended Posts

Okey this might be messy to understand when I explain but I will give it a shot. In my db I got account type "member", "VIP" and "Admin" now I want to add a button that only is visible for say "Admin" and lets call the page admin.php. If lets say a "member" try to enter the admin.php page by enter "www.domain.com/admin.php" they will get kicked back to the home. if anyone know how to do this please help me!

 

Thank you for trying!

Link to comment
https://forums.phpfreaks.com/topic/238399-php-admin-page/
Share on other sites

When anyone logs in, either retrieve and save the account type in a $_SESSION['type'] variable and then check that variable on any particular page to make sure the visitor has the necessary privileges to access that page or to display a link or button and redirect the visitor if they don't have the necessary privileges or don't display the link or button OR even better, execute a query on any particular page that checks if the account type of the current visitor is sufficient to access that page or display a link or button and redirect the visitor if they don't have the necessary privileges or don't display the link or button. This second method allows you (the admin/owner) to change the privileges of a visitor on the fly by simply editing their account type information in your database, in case a visitor is abusing your site.

 

If you search the Internet for php acl (access control list) you can find existing scripts that you can use.

Link to comment
https://forums.phpfreaks.com/topic/238399-php-admin-page/#findComment-1225140
Share on other sites

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.