FIND OUT THE URL OF THE WEBPAGE THAT IMAGE RESIDES ON

Monaj Singh

Total Post:41

Points:287
Posted by  Monaj Singh
 865  View(s)
Ratings:
Rate this:

I would like to make a 1 pixel image that will reside on the html page to track page activity I have a page http:/domain.com/mypage.htm and I want to add <img src='http://www.test.com/myimage.aspx' /> somewhere in its body

 

When page is triggered I render an one pixel transparent image. I'm having an issue finding out the URL of the page that image is on. HTTP_REFERER header carrier the true referer of the page, and HTTP_HOST carries the URL of the image itself.

 

Is there a way to find out the HTML page URL that the image is on?

  1. Anurag Sharma

    Post:40

    Points:280
    Re: Find Out the URL of the webpage that image resides on

    If you can't find it on any http header, you can always send some information like <img src='http://www.test.com/myimage.aspx?page=mypage' />.

     

    If you can use javascript though, you don't need to display an image, use an ajax request instead.

  1. Lillian Martin

    Post:27

    Points:189
    Re: Find Out the URL of the webpage that image resides on

    You can analysis the request headers of myimage.aspx, the Referer header is the HTML page URL you're looking for. Besides, I suggest adding a timestamp with the <img> src link, like this:

     

    <img src="http://www.test.com/myimage.aspx?t=1234567890" />

    So that every time you refresh the HTML page, the browser invoke a new request to the image.

Answer

NEWSLETTER

Enter your email address here always to be updated. We promise not to spam!