in reply to $ENV{'HTTP_REFERRER'} and images

A couple things.
  1. All information the browser sends you is potentially suspect, so keep that in mind.
  2. HTTP_REFERRER for an <img> is the page on which the <img> tag sits. No amount of wishing is going to alter that.
  3. Your best bet is to embed in the img src, a query string parameter reflecting what information you want to pass along. Something like:
    print "<img src=http://www.site.com/my_image.gif?GRANDPARENT=".escape_ +uri($ENV{HTTP_REFERRER}).">";
    So that the HTML generated ends up looking like: <img src=http://www.site.com/my_image.gif?GRANDPARENT=http%3a%2f%2fwww.domain.com%2fmy_other_page.pl">. Then, you can extract that information from the query string when serving the image (or from the access logs on that server, or whatever).
------------ :Wq Not an editor command: Wq

Replies are listed 'Best First'.
Re^2: $ENV{'HTTP_REFERRER'} and images
by funz (Initiate) on Jun 14, 2004 at 04:43 UTC
    Thanks for the help guys, what I ended up doing is using javascript to get the referrer and the when then the program gets the referrer that was added to the query string in the image.