Hi,
I suspect there is a real simple solution to this, but I am clueless...please help!
The situation:
I have a directory on my server containing images called
pic1.jpg, pic2.jpg, pic3.jpg and so on.
Now there are websites out there which leech these images by referencing them with code on their web pages like
<img src = "http://mywebsite.com/images/pic1.jpg">
I know that every time somebody views my images, a hit is registered on my server, which is recorded in the Apache log file provided by my hosting company.
What I would like:
Every time there is a hit to an image, I would like to get details of the person viewing the image (IP address, the time of hit, the ISP etc.) out of my log file and write it to a mysql database on my server.
Please note: I do not want to stop the leeching. I merely want
to know the details of the people doing the leeching.
A sample of my log file is provided at the foot of this posting, between dotted lines.
Is there a solution you can provide or point me to?
Thanks much.
Chokra
24.174.22.233 - - [31/Jul/2004:06:12:19 -0700] " GET /images/pic2.jpg HTTP/1.1" 200 118 "http://www. leechingsite.com" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; .NET CLR 1.1.4322)"
203.94.236.57 - - [31/Jul/2004:20:34:23 -0700] " GET /images/pic2.jpg HTTP/1.1" 304 "http://www. leechingsite.com/index.php" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"
203.94.236.57 - - [31/Jul/2004:20:35:54 -0700] " GET /images/pic1.jpg HTTP/1.1" 304 "http://www.leechingsite.com/index.php" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"
202.56.245.166 - - [31/Jul/2004:10:01:33 -0700] "GET / images/pic3.jpg HTTP/1.0" 304 "http://www. leechingsite.com" "Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0)"