OK, I need some help here. I've been chewing away at this one for days now and I can't figure it out. I basically want something like vBulletin does when you access anything in the /admin directory. Let me explain. Without using .htaccess, I want to do the following:
on any page located in the admin directory either have a "
require("admincheck.php");
or have a function i can call to start the admin check
first off the page/function needs to check if the session variable "adminloggedin" equals true or false. If it equals true, i want that page/function to exit, and then allow the original page to display it's source/do whatever it does.
If adminloggedin= false, then I want it to display a login box, even if the user is already logged in. THe user enters their info, the page/function somehow takes that data, checks it with my database and checks the following: Are the name/pass correct AND is that user's usergroupid= 6(administrator)
If that is true, then adminloggedin needs to be set equal to true, and the original page needs to load and do whatever it does. If the user/pass is incorrect or the user is not an admin, display an error and display the login box, and keep the variable as false.
Basically another admin check security.
So if someone could help me with the coding here that'd be great!!
Thanks!