Solved

How do I know the previous URL ?

Posted on 2001-07-05
4
228 Views
Last Modified: 2008-03-17
Let say I have a ASP page called previous.asp.

How do I know and print out the previous URL before coming to previous.asp.
I am NOT talking about server variable - HTTP_REFERER.

For example, I am viewing 123.45.678.2/test.asp, then I changed my URL at the location
textbox, and typed 123.45.678.2/hello/previous.asp and hit enter to visit previous.asp.

Then, I should see 123.45.678.2/test.asp get printed on the screen. How do I do that ?
0
Comment
Question by:idontknow12002
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 2

Expert Comment

by:rdmjrb
ID: 6258306
I ran across a similar problem and came up short trying to deal with the 'Back' button. The technology simply was not there. When the user does not use your application to navigate you are, as I found, at a loss. However, I would love to see this solution!

1. use the javascript DOM's 'history' object
2. store the name in a hidden variable, pass it along appropriately
3. use a modal browser, with no 'location textbox' or menu items, now you can see where they are coming from and print it out all day
0
 

Expert Comment

by:santhoshgivesuanswers
ID: 6258727

hi..i think history will do it

history.go(-1)  //call this in a function


rgds
san
0
 

Expert Comment

by:Salti
ID: 6259280
URL information in the history object is not accessible as property values in IE. They are in Navigator 4 and later with special privilege.
You can navigate the history object by calling its methods (back(), forward(), go()).
As far as I know, you cannot do what you want to do.
0
 
LVL 4

Accepted Solution

by:
epeele earned 25 total points
ID: 6259480
As long as you are within the same domain, you can write the current page to a Session variable.  You'd do it like this.


<%

   Session("PrevPage") = Session("CurrentPage")
   Session("CurrentPage") = Request.ServerVariables("SCRIPT_NAME")

%>


Or you could hardcode the name of the page where the Request.Server variables is.  This way on each page, you could access the previous page visited by calling:

<%=Session("PrevPage")%>

And when each new page is visited, the value in Session("CurrentPage") is replaces the value in Session("PrevPage") before being overwritten by the actual current page.
0

Featured Post

Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
CDO.Message not able to send attachement 5 43
Syntax for query to update table 2 55
Filktering Alphabetically 8 46
ms sql string field to asp variable as number 5 31
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…
Have you ever needed to get an ASP script to wait for a while? I have, just to let something else happen. Or in my case, to allow other stuff to happen while I was murdering my MySQL database with an update. The Original Issue This was written…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

732 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