ASP Hosting sale!
Double disk space and transfer for FREE!
Limited time offer! Act Now!

aspdev | articles | tutorials | forums

 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Get the referral URL from ASP page

 
Post new topic   Reply to topic    ASPdev.org Forum Index -> ASP programming
View previous topic :: View next topic  
Author Message
Stacy



Joined: 12 Oct 2004
Posts: 9

PostPosted: Wed Nov 10, 2004 3:12 pm    Post subject: Get the referral URL from ASP page Reply with quote

I'm writing ASP stats application and I store information about the users browsing the site in SQL Server 2000 database.

I want to be able to get the URL that the user came in from (the referral URL) and to save this for each visited page. For example, if the user searched on Google about "asp scripts" and then clicked on my site from the search results, I want to save the referrer as the following:

google.com/search?ie=UTF-8&q=asp+scripts

How do I do that?



Thanks,

Stacy
Back to top
View user's profile Send private message
administrator
Site Admin


Joined: 01 Oct 2004
Posts: 183

PostPosted: Wed Nov 10, 2004 4:50 pm    Post subject: Reply with quote

Hi Stacy,

You can use Request.ServerVariables("HTTP_REFERER") to get the referral URL in your ASP pages. Read more about the Request.ServerVariables collection here:

http://www.aspdev.org/articles/asp-servervariables/


Cheers,
_________________
Peter
ASP & ASP.NET Articles and Tutorials
Back to top
View user's profile Send private message
Missie



Joined: 06 Feb 2006
Posts: 25

PostPosted: Thu Feb 09, 2006 8:09 pm    Post subject: Reply with quote

Cool info. I was looking around for info on this exact thing. Thanks for posting it. Smile *me goes off to try it on my site.*
Back to top
View user's profile Send private message
raven



Joined: 31 Jan 2006
Posts: 41

PostPosted: Thu Feb 23, 2006 5:25 pm    Post subject: Reply with quote

Are these all of the request variables or is there a place to get the full list:

Quote:
REMOTE_ADDR - The IP address of the remote host making the request.
REMOTE_HOST - The name of the host making the request.
REQUEST_METHOD - The method used to make the request. For HTTP, this might be GET, HEAD, POST, etc.
SCRIPT_NAME - A virtual path to the script being executed.
SERVER_NAME - The server's host name or IP address
SERVER_PORT - The port number to which the request was sent.

_________________
Programmers do it in code
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    ASPdev.org Forum Index -> ASP programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group

SQL Tutorial