Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Request.ServerVariables("HTTP_REFERER")

Status
Not open for further replies.

MONFU

Programmer
Oct 27, 2001
35
MT
Dear All,

I am trying to write a small banner system and I am trying to get the page from where the banner is displayed. I have tried this piece of code:-

page = Request.ServerVariables("HTTP_REFERER")

however with IE6, it does not work and gives me a blank variable.

Is there a way round this?

Thanks for your help.
 
That variable only works if you use an Response.Redirect page that sends you to the page with the code. Otherwise it wont show you anything,unless you are redirecting from other place.

________
George, M
 
First I am getting the page variable then I am redirecting to another asp which inserts the click in the table:-

ie first
page = Request.ServerVariables("HTTP_REFERER")
and inserting into the banners table with the banner id and page

Then I redirect to another asp if the user clicks the banner and insert a click count into the banner table
 
There is no referer reference in the first page of the web site.
It must be on the redirected page in order to work

IE first page(index.asp)
response.redirect "banner.asp"

Second page(banner.asp)
page = Request.ServerVariables("HTTP_REFERER")

now page should have "



________
George, M
 
Sorry for my late reply.

So if I am displaying a banner on my index page, or on another page, how can I get the page URL to insert into the database? I don't think it makes sense to redirect to the same page that the banner is displayed.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top