gastooon Posted June 4, 2011 Share Posted June 4, 2011 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 More sharing options...
PFMaBiSmAd Posted June 4, 2011 Share Posted June 4, 2011 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 More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.