Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 14th, 2006, 06:49 AM
Authorized User
 
Join Date: Aug 2005
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Default HTTP_REFERER

how to get the url from wher the current page came?
Request.ServerVariables("HTTP_REFERER")
gives that but when there is
<a href = # onclick = "url">link</a>
it doesnt work.
in this case how to get that url from wher this page has come?


 
Old March 14th, 2006, 07:16 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

Are you saying this syntax works?

;;;<a href = # onclick = "url">link</a>

What are you tring to achieve?
Are you aware what the purpose of <a href="#" ...> is used for?


Wind is your friend
Matt
 
Old March 14th, 2006, 08:27 PM
Wrox Technical Editor
 
Join Date: Dec 2005
Posts: 271
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Request.ServerVariables("HTTP_REFERER") returns the URL that referred a visitor to your server.
If you use Response.Redirect, HTTP_REFERER will be empty.

You may want to consider employing a pre-made component for tracking the link usage / site statistics.

Here's a script that will allow you to track internal link usage.
CodeAvalanche LinkTracker: http://m.1asphost.com/xfairguy/lt.asp

- A.Kahtava
 
Old March 14th, 2006, 10:01 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

;;;Once a visitor is on your server, HTTP_REFERER will not return the URL a visitor selects.
Are you sure about this?

What is wrong with Request.ServerVariables("HTTP_REFERER"):
http://www.aspfaq.com/show.asp?id=2169


HTTP_REFERER Returns a string containing the URL of the page that referred the request to the current page using an <a> tag. If the page is redirected, HTTP_REFERER is empty:
http://www.w3schools.com/asp/coll_servervariables.asp

Wind is your friend
Matt
 
Old March 14th, 2006, 10:48 PM
Wrox Technical Editor
 
Join Date: Dec 2005
Posts: 271
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You're right, Mat41...

Thanks for clarifying that... :)

I was thinking about the case after a Response.Redirect...

- A.Kahtava
 
Old March 14th, 2006, 10:54 PM
Friend of Wrox
 
Join Date: Jan 2004
Posts: 1,870
Thanks: 12
Thanked 20 Times in 20 Posts
Send a message via AIM to mat41
Default

No worries mate. You are from Japan, a very interesting place I spent four winters there working on the ski fields all around Nagano.

Let me try and remember some nehongo:

1..doe tashi mustae
2..od-scully suma desta

mmmm, I know how to say it typing it in pigion english seems to be difficult. Can you interpret what i was trying to say?

Wind is your friend
Matt





Similar Threads
Thread Thread Starter Forum Replies Last Post
<%=Request.ServerVariables("HTTP_REFERER")%> t400 Classic ASP Basics 0 June 30th, 2006 07:26 AM
htaccess: restrict by http_referer AND domain TrishD Linux 3 December 5th, 2004 03:38 PM
HTTP_REFERER Tester Sometimes Redirects OK Visitor markw707 Classic ASP Basics 4 August 21st, 2003 11:41 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.