Welcome to WebmasterWorld Guest from 54.211.120.181

Forum Moderators: coopster & jatar k

Message Too Old, No Replies

problem with $_SERVER['HTTP_REFERRER']

Why does it display nothing?

     
1:25 pm on Mar 14, 2004 (gmt 0)

Junior Member

10+ Year Member

joined:June 14, 2003
posts:42
votes: 0


Here is a snippet of code which I have rediced the proble to and worked with to demonstrate the problem.
<?

$ipaddress=$_SERVER['REMOTE_ADDR'];
$referrer=$_SERVER['HTTP_REFERRER'];
print "Ipaddress ".$ipaddress."<br>";
print "Referrer ".$referrer."<br>";

?>

When run there is consistently nothing being printed for the referrer address. (The ip address is fine.) This occurs even when I put a test link on a page on a different unconnected server on the other side of the Atlantic Ocean.

Is there something wrong with the server set up ( out of my direct control.) or is there something I am doing wrong?

1:30 pm on Mar 14, 2004 (gmt 0)

Senior Member from ES 

WebmasterWorld Senior Member 10+ Year Member

joined:Mar 11, 2003
posts:1379
votes: 0


Do you have an antiviru or firewall running on your machine? Try with those off if you do. Norton AV/Firewall hides the referer values...
1:37 pm on Mar 14, 2004 (gmt 0)

Preferred Member

10+ Year Member

joined:Sept 28, 2002
posts:505
votes: 0


Hi Neil,

try the HTTP_REFERER instead (... with only 3 "R"s in the word instead of 4).

:-)

Regards,
R.

1:43 pm on Mar 14, 2004 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Apr 22, 2002
posts:2546
votes: 0


The manual shows it with one (R).

$_SERVER['HTTP_REFERER']

[php.net...]

3:29 pm on Mar 14, 2004 (gmt 0)

Senior Member from ES 

WebmasterWorld Senior Member 10+ Year Member

joined:Mar 11, 2003
posts:1379
votes: 0


Nice catch, romeo!
7:13 pm on Mar 14, 2004 (gmt 0)

Junior Member

10+ Year Member

joined:June 14, 2003
posts:42
votes: 0


Thanks. I'm sure that isn't they way we spell it on this side of the pond. I bet I'm not the first to have this problem though. At least I remember to type <center> not <centre>.
7:33 pm on Mar 14, 2004 (gmt 0)

Administrator

WebmasterWorld Administrator jatar_k is a WebmasterWorld Top Contributor of All Time 10+ Year Member

joined:July 24, 2001
posts:15755
votes: 0


I bet I'm not the first to have this problem though

far from it, no one spells it that way

from the dictionary

<World-Wide Web> A misspelling of "referrer" which somehow made it into the HTTP standard. A given web page's referer (sic) is the URL of whatever web page contains the link that the user followed to the current page. Most browsers pass this information as part of a request.
8:16 pm on Mar 14, 2004 (gmt 0)

Junior Member

10+ Year Member

joined:June 14, 2003
posts:42
votes: 0


That explains it. I checked it out afterwards and found that everyone spells it the same way. I thought it might have been my English. It isn't the native langauge around here and lately I have not been using it so much.
I can spell
Llanfairpwllgwyngyllgogerychwyrndrobwllllantisiliogogogoch perfectly :-) (It is an actual real place name.)