Current location: Hot Scripts Forums » Programming Languages » ASP » HTTP_REFERER not working


HTTP_REFERER not working

Reply
  #1 (permalink)  
Old 02-19-04, 05:25 PM
Kaikki Kaikki is offline
Newbie Coder
 
Join Date: Aug 2003
Location: Europe
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
HTTP_REFERER not working

Hi all

I have searched hi and lowfor an answer to this question and am hoping that someone can help me with a solution to an alternative to this problem.

Basically the HTTP_REFERER function is not working for me as it returns no values? I have tried various versions of writing it and nothing works (I have even checked the spelling of the word as I can see that many people have had problems due to incorrect spelling )
The method that I am using is written like this:
<%= Request.ServerVariables("HTTP_REFERRER")%>
The above version returns nothing.
The pages URL that I am requesting is the page a visitor was on before they CLICKED A LINK from that page to this one(emailfriend link).

The method <%= Request.ServerVariables("URL")%> is working but is not useful to me as it just returns the address of the LINK that the User pressed.

Does anybody have some other method of retrieving a page address other than using the HTTP_REFERRER?

Hope somebody has some ideas.

Kind Regards
Kaikki
Reply With Quote
  #2 (permalink)  
Old 02-19-04, 05:47 PM
Stealth Stealth is offline
1337 pr0gr4mm3r
 
Join Date: Jun 2003
Location: Glasgow, Scotland
Posts: 188
Thanks: 0
Thanked 0 Times in 0 Posts
<%= Request.ServerVariables("HTTP_REFERER")%>

Some firewalls especially norton firewall block the referer so the client sends it back blank. this is probably where your falling.


my my calculations from a table which logs the referers against a return of no referer (blocked by firewall, proxy etc) approx 35% of users had no referer. This figure wont be exact but its pretty accurate
Reply With Quote
  #3 (permalink)  
Old 02-19-04, 05:56 PM
Kaikki Kaikki is offline
Newbie Coder
 
Join Date: Aug 2003
Location: Europe
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by Stealth
<%= Request.ServerVariables("HTTP_REFERER")%>

Some firewalls especially norton firewall block the referer so the client sends it back blank. this is probably where your falling.


my my calculations from a table which logs the referers against a return of no referer (blocked by firewall, proxy etc) approx 35% of users had no referer. This figure wont be exact but its pretty accurate
Hi Stealth, thanks for the fast reply

You are absolutely correct about Norton. Is there an alternative way of getting the refferer? I need it for email friend form, rather than passing each and every URL manually to the email page. (I have alot of pages that are not running with a database).

Kind Regards
Kaikki
Reply With Quote
  #4 (permalink)  
Old 02-19-04, 11:35 PM
Xtremist Xtremist is offline
Newbie Coder
 
Join Date: Aug 2003
Location: Pensacola, FL
Posts: 99
Thanks: 0
Thanked 0 Times in 0 Posts
you could always put something that would tell you what page you were on....

Example.... Here is the page with the email to friend link.... it has a button or link that is this....

http://www.mysite.com/emailtofirend....e=thispage.asp

Then you have in the form where they enter the info a hidden field that request the current page... when submitted it does the e-mail and whatever data inserts and then responses redirects to the request.querystring or form currentpage...

does that make sense.... basicly pass that to two pages..... sorry if I sound like I've had a few beers but I have
__________________
Chris
http://www.pensacolawebdesigns.com
I know it's not much but I never find time to work on my own site
Reply With Quote
  #5 (permalink)  
Old 02-20-04, 06:56 AM
Stealth Stealth is offline
1337 pr0gr4mm3r
 
Join Date: Jun 2003
Location: Glasgow, Scotland
Posts: 188
Thanks: 0
Thanked 0 Times in 0 Posts
Quote:
Originally Posted by Kaikki
Hi Stealth, thanks for the fast reply

You are absolutely correct about Norton. Is there an alternative way of getting the refferer? I need it for email friend form, rather than passing each and every URL manually to the email page. (I have alot of pages that are not running with a database).

Kind Regards
Kaikki

Theres no other way to get the referer since it will be blocked. but do as Xtremist says. Put the request.servervariables("URL") or request.servervariables("PATH_INFO") into a hidden input in your form

<input type="hidden" name="referer" value="<%=request.servervariables("PATH_INFO")%>">
Reply With Quote
  #6 (permalink)  
Old 02-21-04, 06:05 AM
Kaikki Kaikki is offline
Newbie Coder
 
Join Date: Aug 2003
Location: Europe
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Hi Xtremist and Stealth,

Thanks for both of your feedback and advice, it is as usual very much appreciated

I will try the two ways that you have both suggested and figure out which one works best for me.

Thanks again,

Kind Regards
Kaikki
Reply With Quote
  #7 (permalink)  
Old 02-22-04, 02:38 PM
EzASPSite's Avatar
EzASPSite EzASPSite is offline
Newbie Coder
 
Join Date: Nov 2003
Posts: 23
Thanks: 0
Thanked 0 Times in 0 Posts
There are many other options you can use such as putting the SCRIPT_NAME combined with QUERY_STRING and saving together in a variable to pass on.

Look over all the Request.ServerVariables Objects here:

http://www.4guysfromrolla.com/webtech/092298-3.shtml
__________________
<a href="http://www.vebro.net" alt="Vebro Solutions" title="Vebro Solutions">Vebro Solutions</a>&nbsp;:&nbsp;<a href="http://www.vebrohosts.com" alt="Vebro Hosts" title="Vebro Hosts">Vebro Hosts</a><br><br><a href="http://www.ezaspsite.com"><img src="http://www.ezaspsite.com/images/EzASPSitesmall100x30.gif" border="0" alt="EzASPSite™"></a>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;EzASPSite™
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP not working in IIS5 on WinXP Pro cistate ASP 5 06-18-04 02:31 PM
Links not working with Left Click but will open with Right Click... Xtremist HTML/XHTML/XML 2 03-02-04 12:12 PM
calendar working until months changed bitesize JavaScript 1 01-13-04 01:50 PM
If/else statement working...but not working mdhall PHP 13 10-16-03 08:47 AM
can some help me to get this script working cabj1981 ASP 5 09-26-03 10:50 AM


All times are GMT -5. The time now is 04:12 PM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.