Hey guys,

I have a protected subdirectory I use on my web site to keep php scripts like ones that delete records from being used by anybody. I set up the protected subdirectory using the Apache web server's .htaccess and .htpasswd files.

What I would like to do is write out to a log the name of whoever accesses these protected files. I have the log stuff worked out, but how do I tell who accessed the protected subdirectory? Is there a variable passed by the .htaccess files? Is there a way to grab the login info, or does this method only work as a gatekeeper, and after people get by, the scripts don't know who they are?

Much thanks,
Chuck Cruse

    When someone accesses the directory protected by htaccess they will start passing an authorized user variable which you can access using $_SERVER[PHP_AUTH_USER] or if you have register_globals on you can use $PHP_AUTH_USER.

      Cool cool cool! It worked! Thanks a lot man.

      Chuck

        Write a Reply...