Private Label and Cobranded VoIP Solutions
BrainCast internet & phone based message/memo recording & reminder organization system
Internet Phone Service and Broadband Phone Service by ViaTalk

Go Back   VoIP Forums, Internet Phone Service Forums, & Web Hosting Forums > CoderForums - Programming Discussion > General Programming Issues > Programming Languages & Technologies > PHP

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 03-11-2002, 05:22 AM
ajc ajc is offline
Senior Customer
 
Join Date: Feb 2001
Location: UK
Posts: 173
Http_referer

My site uses the PHP variable $HTTP_REFERER to provide a link back to the calling page. This worked fine, but now the server has been upgraded to 4.1.2 it seems to have stopped working.

If I look at phpinfo on my domain the variable is not shown. Where has it gone, and what can I do to recover it ?

Has anyone else noticed this problem ?

Allen
__________________
Allen
Mavis Crafts|Healthy Living Products
Reply With Quote
  #2  
Old 03-14-2002, 05:23 AM
ajc ajc is offline
Senior Customer
 
Join Date: Feb 2001
Location: UK
Posts: 173
Doesn't anyone else use HTTP_REFERER in PHP ?

Allen
__________________
Allen
Mavis Crafts|Healthy Living Products
Reply With Quote
  #3  
Old 03-14-2002, 05:33 PM
ajc ajc is offline
Senior Customer
 
Join Date: Feb 2001
Location: UK
Posts: 173
This is the reply I got from a trouble ticket:

Hello Allen,
We have turned HTTP_REFERER off on all of the servers because it causes high server.

Allen
__________________
Allen
Mavis Crafts|Healthy Living Products
Reply With Quote
  #4  
Old 03-16-2002, 09:07 PM
Jim Dam Jim Dam is offline
Registered User
 
Join Date: Mar 2002
Posts: 11
$HTTP_REFERER works on my site (well, in the form $_SERVER['HTTP_REFERER'] at least).
Reply With Quote
  #5  
Old 03-17-2002, 02:42 PM
ajc ajc is offline
Senior Customer
 
Join Date: Feb 2001
Location: UK
Posts: 173
Jim,

What server are you on ?
I put the $_SERVER['HTTP_REFERER'] form into a PHP that I link to from http://www.mavis-crafts.com/test.html, but nothing gets displayed. The code I use in the PHP page is:

<?php echo $_SERVER['HTTP_REFERER']; ?>

Is there anything wrong with that ?

Allen
__________________
Allen
Mavis Crafts|Healthy Living Products
Reply With Quote
  #6  
Old 03-17-2002, 09:34 PM
Jim Dam Jim Dam is offline
Registered User
 
Join Date: Mar 2002
Posts: 11
Actually, I don't know which server I'm on right now. I'll try to find out.

But, I believe it might be your browser, for this is what I see when I go to that page and click the link:
http://www.mavis-crafts.com/test.html

What browser are you using? I am using Internet Explorer 6 on Windows XP, and I believe referer works in most browsers, but not all.
Reply With Quote
  #7  
Old 03-17-2002, 10:42 PM
JoeF JoeF is offline
QL User
 
Join Date: Jan 2002
Posts: 71
Quote:
Hello Allen,
We have turned HTTP_REFERER off on all of the servers because it causes high server.
LMAO, it causes the server to smoke pot or do crack or something?
__________________
--
Joe F
Reply With Quote
  #8  
Old 03-18-2002, 10:36 AM
ajc ajc is offline
Senior Customer
 
Join Date: Feb 2001
Location: UK
Posts: 173
I am using IE6 on Windows XP professional. I seems to work okay from another machine using IE5 and Windows NT4. So it looks like it is an environmental thing.

I also have ZoneAlarm Pro and Norton Antivirus 2002 running. I'm not sure if these could be affecting the setup.

Allen
__________________
Allen
Mavis Crafts|Healthy Living Products
Reply With Quote
  #9  
Old 03-18-2002, 02:00 PM
top5mov top5mov is offline
Senior Customer
 
Join Date: Jun 2001
Location: Pittsburgh
Posts: 266
firewalls like ZoneAlarm or Norton can prevent the HTTP_REFERER from being included in http headers.

as a replacement for the referer variable, a cookie indicating the previous page could be used. basically, every page on your site would read a cookie called, say, "previousPage" and use that as the input for the "back" link. then, write the name of the current page to the "previousPage" cookie, so that the next page you load will know you came from the current page.

obviously, that only works for returning visitors to other parts of your own site, but at least it's an option.
Reply With Quote
  #10  
Old 03-18-2002, 06:26 PM
ajc ajc is offline
Senior Customer
 
Join Date: Feb 2001
Location: UK
Posts: 173
Of course this assumes that all users accept cookies. The other way would be to send it as part of the query string (since it is going to a PHP script).
__________________
Allen
Mavis Crafts|Healthy Living Products
Reply With Quote
  #11  
Old 03-18-2002, 06:32 PM
ajc ajc is offline
Senior Customer
 
Join Date: Feb 2001
Location: UK
Posts: 173
After have a play with Zonealarm Pro I found the source of my problem. The firewall was set-up to remove what it calls 'private header information'. This seems to remove the referer information.

The trouble now is that I need a solution as anyone using my site could be having problems due to this 'feature'.

I think the only reliable solution is to pass the page as a parameter in the query string.

Any better solutions ?

Allen
__________________
Allen
Mavis Crafts|Healthy Living Products
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

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 On
HTML code is Off
Forum Jump