Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

htaccess logger

Status
Not open for further replies.

kevinpham

Programmer
Dec 21, 2001
32
US
hi,
I am kinda new to htaccess. I am writing a user management script and just wonder how to log user when they login via the protected directory pop up dialog?
I have seen many scripts can log user ip address and more to prevent shared usernames...

thanks
 
If they're logging in via the browser popup dialog, I don't think you can do it, since that's automatically negotiated between the browser and the web server. The programs you've seen either use mod-perl and a variation of basic authentication to handle logging in, or they don't use .htaccess at all. Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Hi,

Well you can determine a user's login name with the htaccess popup field from a cgi script, this simply by using the %ENV, with this you can get the enviroment vars for that "session".

e.g.
$ENV{'REMOTE_USER'}
Same goes for IP and browser etc etc etc ...
if you want a list, put this in a script:

foreach $key (sort keys %ENV)
{
print &quot;$key\n<br>&quot;
}

Grtz Funs

funs@euro.net

 
I've posted some code somewhere in this forum that you can use for parsing out the username for a .htaccess login. Try searching this forum for REMOTE_USER. Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top