3

How can I get a list of webpages that contain the image in question? Photobucket has a stats option which lets you see what websites have embedded your image. How do they do that?

Jack
  • 31
  • 1
  • Interesting, how could you get this using PHP? – Jonathan. Apr 16 '10 at 14:55
  • @Jonathan: Depends on your server configuration. If you are able to access the webserver logs via PHP, you could open it, detect any lines that denote a request for the image in question (a for-loop over each line executing a strpos), get the column of the referer (via explode), put that into an array, sort it, throw out any redundant or nonsense referers (at least "-"), and you've got a fairly complete list of any webpage that embeds your image, provided someone without privacy tools visited that page already. OTOH, you cannot get any pages that hosts a copy of your image. – orithena Apr 17 '10 at 16:04

2 Answers2

3

I'd assume photobucket checks the webserver logs, looking for the referer in any request for a specific image.

For any HTTP request, the browser also sends the so-called referer which contains the URL that "triggered" the request. If someone clicks on a link to webpage B in webpage A, the browser not only requests the linked webpage from the server of webpage B, but also sends the referer along, containing the URL of the "linking webpage" A. Same goes with images embedded in a webpage. The request for the image also contains the URL of the embedding webpage so the server can log which pages embed an image.

Of course, this could be suppressed by privacy tools in the user's browser, so the method would not be completely correct, but in most cases its sufficient.

See also http://en.wikipedia.org/wiki/HTTP_referrer

orithena
  • 1,455
  • 1
  • 10
  • 24
1

My guess is that they're seeing what web pages are pulling the embedded image by parsing the server logs.

Stephen Wrighton
  • 36,783
  • 6
  • 67
  • 86