Arrays with if statements
Posted: Sat May 28, 2011 1:13 am
In my CMS site, there is an admin section of the site. I am an admin, but I want more than one username to be an admin, how would i do this by adding multiple users into an array for administrator based on if they are set to admin in the database.
here is what I have as far as setting admin status:
I want to keep that structure of the admin link based on if the user logged in is an admin, but using an array instead of just the username itself.
here is what I have as far as setting admin status:
Code: Select all
if($_SESSION['user']=='Administrator') {
echo '<p align="center">| <a href="admin/">Admin</a> |</p>';
}