Click to See Complete Forum and Search --> : ASP Referring URL Question...
kwilliams
10-14-2004, 03:37 PM
I'm trying to pull the user's referring URL so that I can create an "Automatic Redirect" page (i.e. "You've visited an old URL, and will be redirected to the new URL in 5 seconds...). But when I tried using:
<%=Request.ServerVariables("HTTP_REFERRER")%>
..I didn't receive a result. I created a link to the test page from another test page, but it still didn't pull it in. Is there a guaranteed way to pull a referring URL with ASP or another language? If so, how? Thanks for any help.
russell
10-14-2004, 04:27 PM
You spelled it wrong. It's HTTP_REFERER
kwilliams
10-14-2004, 04:32 PM
...actually "referrer" has two r's in the middle, not one. I even checked with Word's spell check to make sure that I hadn't lost my mind. Any other suggestions?
russell
10-14-2004, 04:35 PM
You have the correct dictionary spelling of the wrod referrer. However, what I posted was the correct Environment variable spelling.
Do this:
For each r in Request.ServerVariables
Response.Write r & " " & Request.ServerVariables(r) & "<br>"
Next
That'll show you everything in the collection.
kwilliams
10-14-2004, 04:36 PM
Ok, I'll give that a try. But I didn't at all get that from your first post:
You spelled it wrong. It's HTTP_REFERER
Thanks.
kwilliams
10-14-2004, 04:41 PM
Ok, it worked. But I'm kind of confused on why they would use the incorrect spelling of "referrer" within the "Request.ServerVariables" method. I actually first learned of that method, along with the other items in the collection, from a few good reference sites. Anyway, thanks for pointing that out to me. I appreciate your help.
russell
10-14-2004, 04:44 PM
Don't know why they spelled it wrong. Glad to help.