Security is a big deal for me. I hate seeing code with holes in it and how easily it would be for someone to hack it.
I have a good login security login example I can post. If you want to see it let me know.
As for your question, just use an if statement.
$admin = false;
if ( $_SESSION['SESS_ADMIN'] == 'ADMIN' ) { //whatever the value is in the database for an admin
$admin = true;
}
Then in your script where you want something for an admin only.
if ( $admin ) {
echo 'html that only admins should see';
}
Really the best thing to do is seperate the user and admin areas completely.
Last edited by kkeith29; Jul 4th, 2009 at 12:42 am.
Reputation Points: 235
Solved Threads: 193
Nearly a Posting Virtuoso
Offline 1,315 posts
since Jun 2007