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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

.htaccess ip address logger

Status
Not open for further replies.

kevinpham

Programmer
Dec 21, 2001
32
US
Apache use .htaccess to protect directories. Is there anyway i can log the person' username and Ip address to prevent sharing.

I have encounter numerous scripts that detect how many times you have logged in, but just wonder how can they detect???

Any help would be abbreciated.
kevin
 
The IP address is logged by Apache, the username you would have to log yourself somehow. //Daniel
 
If you say Apache logs the IP address, so how do I retrieve that ip address?

My intention was to use a cgi script to log username, ip address, as well as the time the person logged in to a og file. The last can be done easily, but how do i do the first two?

Any help would appreciate cheer
kevin
 
The IP-address can be accessed via the variable $ENV{'REMOTE_ADDR'}.
I have no idea about the username though. //Daniel
 
Hi everyone,
Maybe my question was not clear.... and maybe I have confused myself and everyone. I well know about %ENV, but my question was: How do you log the person usernam and IP address?

If it is a standalone script, then whoever call the script will reveal his IP address and other infor to the %ENV and pass to the script, but that WAS NOT my question of how to obtain the IP address when someone CALL the script, but how to obtain the ip address when someone LOGIN into a htaccess protected directory.

I thought there should be someone here who have working knowledge on htaccess and apache server, but all answers I recieved was not what I looked for, but thanks anyway.... I guess I have to look elsewhere

Thanks for all who response cheer
kevin
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top