Solved

Get URL and Previous URL

Posted on 2003-11-10
10
1,142 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
 
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 125 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
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
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 your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

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…
Hello, all! I just recently started using Microsoft's IIS 7.5 within Windows 7, as I just downloaded and installed the 90 day trial of Windows 7. (Got to love Microsoft for allowing 90 days) The main reason for downloading and testing Windows 7 is t…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…

746 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now