I am new to PHP, please forgive me if this is a dumb question.. I have searched php.net and various php faqs and haven't been able to find this information...
I have a directory that contains all the admin scripts for my site. Currently it is protected by an htaccess file, which allows access to 2 different admins.
What I would like to do is determine, in PHP code, which admin is logged in--not for authentication, but so that they won't have to then select their user name from a combo box in order for PHP to know who is logged in (after they already entered username and password for htaccess). I've looked at $SESSION[] array but haven't had much luck.
Is this possible?
Way to get user name logged in with htaccess?
Moderator: General Moderators
-
kipthegreat
- Forum Newbie
- Posts: 2
- Joined: Thu Sep 22, 2005 12:28 pm
- Maugrim_The_Reaper
- DevNet Master
- Posts: 2704
- Joined: Tue Nov 02, 2004 5:43 am
- Location: Ireland
Could save the username off to a cookie using setcookie().
Assuming it's not an authentication requirement, PHP could just read in the cookie (once you make sure to filter it) and bypass the form. Hey presto... If the username needs to be changed to another - offer a link to the form (a non-bypassed version) or similar.
Assuming it's not an authentication requirement, PHP could just read in the cookie (once you make sure to filter it) and bypass the form. Hey presto... If the username needs to be changed to another - offer a link to the form (a non-bypassed version) or similar.
-
kipthegreat
- Forum Newbie
- Posts: 2
- Joined: Thu Sep 22, 2005 12:28 pm