[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

Get URL and Previous URL

Posted on 2003-11-10
10
Medium Priority
?
1,156 Views
Last Modified: 2007-12-19
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
0
Comment
Question by:swtlbee
  • 4
  • 2
  • 2
  • +2
10 Comments
 
LVL 4

Expert Comment

by:ainapure
ID: 9717472
there is just a spelling mistake in ur code. Use the following line

PrevSite=Request.ServerVariables("HTTP_REFFERRER")


Hope this helps
-amit
0
 

Author Comment

by:swtlbee
ID: 9717607
Ok, change the spelling but I still get PrevSite=""

<%
PrevSite= Request.ServerVariables("HTTP_REFFERRER")
%>
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 9717617
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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 9717624
To see all values, try:

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

FtB
0
 
LVL 4

Accepted Solution

by:
ainapure earned 375 total points
ID: 9717635
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
 
LVL 58

Expert Comment

by:Gary
ID: 9717972
But spelling it right (well wrong but blame MS) will help - REFERRER
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 9718014
as opposed reeferer ;->


FtB
0
 
LVL 29

Expert Comment

by:Göran Andersson
ID: 9718288
Copy-paste from MSDN... The correct spelling is:
HTTP_REFERER
0
 
LVL 58

Expert Comment

by:Gary
ID: 9718402
reeferer ?? (Have you been smoking something Fritz)
0
 
LVL 46

Expert Comment

by:fritz_the_blank
ID: 9718445
Uhmmm....No?    ;->

FtB
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:   The Exchange of informatio…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…
We’ve all felt that sense of false security before—locking down external access to a database or component and feeling like we’ve done all we need to do to secure company data. But that feeling is fleeting. Attacks these days can happen in many w…
Suggested Courses

873 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question