Request.ServerVariables("HTTP_REFERER")

J

JW

I use Request.ServerVariables("HTTP_REFERER") to get the URL of the referrer
page.

However, if the page that has Request.ServerVariables("HTTP_REFERER") is in
a popup window then the value is blank!!

Can anone assist as to how to solve this problem.

The requesting page is at http://www.theexperts.co.uk/error.htm

The ASP code is:

<%
TheirURL = Request.ServerVariables("HTTP_REFERER")

sVar = TheirURL

aVar = Split(sVar, "/")

sDomain = aVar(2)

If Lcase(Left(sDomain, 4)) = "www." Then
sDomain = Right(sDomain, Len(sDomain) - 4)
End If

Response.Write sDomain
%>

Thanks

Jon
 
J

JW

Sorry, posting this twice as it tagged on to a spetember posting:
---------------------------------------------------------------

I use Request.ServerVariables("HTTP_REFERER") to get the URL of the referrer
page.

However, if the page that has Request.ServerVariables("HTTP_REFERER") is in
a popup window then the value is blank!!

Can anone assist as to how to solve this problem.

The requesting page is at http://www.theexperts.co.uk/error.htm

The ASP code is:

<%
TheirURL = Request.ServerVariables("HTTP_REFERER")

sVar = TheirURL

aVar = Split(sVar, "/")

sDomain = aVar(2)

If Lcase(Left(sDomain, 4)) = "www." Then
sDomain = Right(sDomain, Len(sDomain) - 4)
End If

Response.Write sDomain
%>

Thanks

Jon
 
T

Tony B

JW said:
I use Request.ServerVariables("HTTP_REFERER") to get the URL of the referrer
page.

However, if the page that has Request.ServerVariables("HTTP_REFERER") is in
a popup window then the value is blank!!

Can anone assist as to how to solve this problem.

The requesting page is at http://www.theexperts.co.uk/error.htm
<code snipped>

I'd guess it because you are not clicking a link to get to the page.
Javascript is making a new request for you. You'll get a blank referer if
you type the target url into your address bar.

To get around it I'd suggest that you append the requesting url to a
querystring value to the called asp page and extract it from there.

a href="#"
onclick="(window.open('http://www.compasscomputing.co.uk/error.asp?'+locatio
n.href, 'Error',
'width=400,height=575'))">Please click here to report web site errors, thank
you.</a>

In the error.asp page if you can't find a HTTP_REFERER check
Request.QueryString("fromPage")

Tony
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,053
Latest member
BrodieSola

Latest Threads

Top