How to get the requesting URL

M

magic kat

How can I get the full url of the page that is calling my page? I tried the
below, but it gives me my page, not the page that redirected to me.
' Dim sURL as String

'if strcomp(Request.ServerVariables ("HTTPS"), "ON", 1) = 0 then

' sURL = "https://"

'else

' sURL = "http://"

'end if

' sURL = sURL & Request.ServerVariables ("SERVER_NAME")

' sURL = sURL & Request.ServerVariables ("SCRIPT_NAME")

' if len(trim(Request.QueryString.tostring)) > 0 then

' sURL = sURL & "?" & Request.QueryString.tostring

'end if

'Response.Write(sURL)

Thanks.
 
M

Mark Rae [MVP]

How can I get the full url of the page that is calling my page? I tried
the below, but it gives me my page, not the page that redirected to me.

Request.ServerVariables("HTTP_REFERER")

However, this can't be relied upon, as some browsers are able to spoof it,
and many ISPs strip it from the Request headers...
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top