ASP Is Fun

Learning ASP
Free Course
Basics
Functions
SQL Commands
Sample Code

Servers / Setup
Host Reviews
Server Setup
Error Tips

Contract ASP
Development

Search For:



Intro to ASP


 
ASP Intro Ebook


Referring URL with HTTP_REFERRER



When you are coding ASP pages, you often want to know where the user came from. Using HTTP_REFERRER lets you code your pages based on what path the user followed.

Simply put, add this code to your ASP page -

RefURL = Request.ServerVariables("HTTP_REFERRER")

Now you have the full value of the previous URL in the RefURL variable. Users can of course block this with their browser settings if they want to, but not all users are quite that paranoid about their security settings.

There are many reasons that knowing the referring page can be useful.

* You can make sure that a thank you page thanks the person based on what product they bought.

* You can ensure that a paypal return page only activates fully for someone that really DID just come from the PayPal website.

* If someone tries to 'leap' to a end-stage page directly, you an always response.redirect the user back to the starting point.

Make sure you do account for users that have blocked this feature, so they at least see a page explaining that they need to change their security settings.

ASP Utility Code


ASP Main Page | ASP Ebooks | Free ASP Course | Contact Lisa
All content copyright © 2010 Minerva WebWorks LLC. All rights reserved.

Italian Wedding


Free Newsletter!

Ebooks
Intro to ASP
ASP SQL DB
Members
Shopping


Introduction to ASP

Romance Tips
Irish Romance
Italian Romance
French Romance

ASP Poll
How do you handle 500 errors?
I don't
Page does nothing
Displays error
Emails error