Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

ASP Linking

Posted on 2004-08-03
2
Medium Priority
?
254 Views
Last Modified: 2010-04-17
I know in PHP, the code to grab a link is echo $link

How can I grab a URL from a previous page using ASP?

Thanks!
0
Comment
Question by:Nitestarz
[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
2 Comments
 
LVL 18

Accepted Solution

by:
tusharashah earned 2000 total points
ID: 11705062

request.servervariables("http_referer")

[providing that the page the script placed on is not the startup page for the browser session, was not hard coded into the address bar or not opened as a favorite.]

- tushar
0
 
LVL 2

Expert Comment

by:MGrassman
ID: 11705118
Here ya go.
<%
    Response.Write "Referer: " & Request.ServerVariables("HTTP_REFERER")
%>

This won't work in all cases though.  Below is a list of what will and will not work.


The situations where this ServerVariable works
---clicking on a straight HTML <a href> link;
---submitting a form, using POST or GET, from a submit button, <input type=image> or client-side script (form.submit())

The situations where it doesn't work:
---clicking on a Favorite, History, or the recently-typed URLs list
---clicking on 'Home' in IE's toolbar, or an item in IE's 'Links' toolbar
---using location.href or location.replace() in client-side JScript/JavaScript/VBScript
---using HierMenus (details)
---typing the URL directly in the browser and hitting Enter or clicking 'Go'
---launching a clickable URL from an e-mail or MS Office document
---using Response.Redirect / Server.Transfer
---using Response.AddHeader (302) or <meta http-equiv=refresh> to redirect
---misspelling the variable name (many people assume HTTP_REFERRER).
---Obviously, this variable cannot be relied upon for many situations.
 
Hope this helps,

Michael Grassman
{personal website url removed - ee_ai_construct, cs moderator}
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
The SignAloud Glove is capable of translating American Sign Language signs into text and audio.
An introduction to basic programming syntax in Java by creating a simple program. Viewers can follow the tutorial as they create their first class in Java. Definitions and explanations about each element are given to help prepare viewers for future …
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…

721 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