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

Request.ServerVariables("HTTP_REFERER") - posted again by JW

JW
Sun Nov 02 08:18:39 CST 2003

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




Re: Request.ServerVariables("HTTP_REFERER") by Tony

Tony
Sun Nov 02 17:01:58 CST 2003


"JW" <jon_webb@#NOSPAM#yahoo.com> wrote in message
news:bo33bt$6l$1@hercules.btinternet.com...
> 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