Not really sure what was wrong, it didn't output an error. I put ``(s) around the `users` table.
Well you need to get the user's rank from the database..
PHP Code:
$username = "Caleb"; // you can get this from a session, wherever.
$logged = mysql_query("SELECT * FROM `users` WHERE `username`='$username'");
$logged = mysql_fetch_array($logged);
if($logged["rank"] != "1") {
// not an admin.
exit("Not an admin."); // you can redirect to an error page, include something here, doesn't matter, just exit.
}
// aha.. they are an admin.. show the content.
echo "Secret Stuff.";
You can put the $logged part somewhere else, and use it cross-site.