hot to know the referrer to a site

Results 1 to 2 of 2

Thread: hot to know the referrer to a site

  1. #1
    Join Date
    Dec 1969

    Default hot to know the referrer to a site

    I have a script which serves a small graphic to many external web sites. This works because in the image tag on the external sites, the source is and this script after taking some data, redirects the referrer to a GIF file. The thing I want to know is, how can I find out where the request came from - i.e. the url of the external page? I have tried the request.ServerVariables parameters but can&#039t see anything there.<BR><BR>Thanks for your help<BR>DC

  2. #2
    Markkk Guest

    Default RE: hot to know the referrer to a site

    Request.ServerVariables("HTTP_REFERER") should work.<BR><BR>Remember, that the HTTP_REFERER variable is empty if you type your page directly into your browser&#039s address bar (page was not referred, but rather directly requested).<BR><BR>Also, if you script redirects from Page1.asp to Page2.asp to the gif file, the servervariables are not passes along via the redirects.<BR><BR>e.g. the HTTP_REFERER variable obtained in Page1.asp is not passed along to Page2.asp via a Response.Redirect statement. So, if you are looking for a server variable in was lost during the Redirect. To preserve it, you must pass it along as a Querystring variable, or via custom server variable.<BR><BR>I hope this helps.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts