Get URL and Previous URL

I am trying to get the user URL and previous URL.
I'm using server varialble

HOST, URL and Referer,  I'm able to get the host and url but can't get the previous page, HTTP_REFERER.

Am I doing something worng why can't I?

<%
Host = Request.ServerVariables("HTTP_HOST")
Url = Request.ServerVariables("URL")
PrevSite = Request.ServerVariables("HTTP_REFERER")
%>

Thanks
swtlbeeAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

ainapureCommented:
there is just a spelling mistake in ur code. Use the following line

PrevSite=Request.ServerVariables("HTTP_REFFERRER")


Hope this helps
-amit
0
swtlbeeAuthor Commented:
Ok, change the spelling but I still get PrevSite=""

<%
PrevSite= Request.ServerVariables("HTTP_REFFERRER")
%>
0
fritz_the_blankCommented:
Request.ServerVariables("HTTP_REFFERRER") will only give you a value if someone arrived at that page via a hyperlink. Otherwise, you will get an empty string.

FtB
0
Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

fritz_the_blankCommented:
To see all values, try:

for objItem in Request.ServerVariables
  response.write(objItem & ": " & request.servervariables(objItem) & "<br>")
next

FtB
0
ainapureCommented:
say your above lines of code is in a page on ur website called http://mysite/test.asp then for testing what u need to do is first visit some other site and in the same browser then go to your test page, I hope you didnt test the code by launching the new browser window and executing your page because then prevsite will be emtpy.

-amit
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
GaryCommented:
But spelling it right (well wrong but blame MS) will help - REFERRER
0
fritz_the_blankCommented:
as opposed reeferer ;->


FtB
0
Göran AnderssonCommented:
Copy-paste from MSDN... The correct spelling is:
HTTP_REFERER
0
GaryCommented:
reeferer ?? (Have you been smoking something Fritz)
0
fritz_the_blankCommented:
Uhmmm....No?    ;->

FtB
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.