...

View Full Version : Get Refer(r)er Information | FF/IE | Problem | Please help!



donsebo
08-31-2011, 03:30 PM
Hi Community,

I have a question regarding referer. I use XAMPP to test my file BEFORE uploading to the server ("Never change a running system"...) and now I want to implement a self-written referer statistic.

To test if I can get the refering information I use following two files (1.php & 2.php)

1.php:

<html>
<head>
</head>
<body>
<a href="2.php">Hier gehts weiter</a>
</body>
</html>

2.php:

<?php echo(getenv('HTTP_REFERER')); ?>
<br />
<script>document.write(document.referrer)</script>

On my local computer (XAMPP) this is working fine.
On my webhost (united-domains ) it is working with IE but not with FF.

So it is clearly a "problem" with Firefox. I know I can turn on referer in about:config, but I never turned it off...
So the visitors with a normal FF installation are not all trackable...

I also now that some firewalls block the referer.

I also know, that its not the best way of getting referer information by using the HTTP request...

But, people, tell me how the "big" tracking scripts retrieve the information of the referer (for e.g. traffic trading script or similar).

there must be a easy way, [I]or? Please help me! :)

Have a nice day!

Fou-Lu
08-31-2011, 03:38 PM
There is no problem here.
env HTTP_REFERER is a client provided server variable; there is no guarantee that this property will ever be provided to you by a browser. There is also no way to force a browser to provide it to you.

So what it boils down to is this is a browser configuration issue, not a PHP one.

donsebo
08-31-2011, 03:49 PM
There is no problem here.
env HTTP_REFERER is a client provided server variable; there is no guarantee that this property will ever be provided to you by a browser. There is also no way to force a browser to provide it to you.

So what it boils down to is this is a browser configuration issue, not a PHP one.

You are right ;-)

Sorry, can you please move this thread to client based forum?

But how can professional tracking scripts track persons who use firefox like me? How do they get the referer url, when firefox hides the refering information automatically?

AND: Why does it work on my local machine (XAMPP) with FireFox but not after uploading to the server?

Strange, or?

All the best!

Fou-Lu
08-31-2011, 04:02 PM
That sounds to me like a configuration issue, either in your install of FF preventing non-local publishing of the referrer (no clue if this is an actual configuration or can be changed), or the webserver is not registering them.
One thing to check is that it doesn't exist in the $_SERVER super global instead of getenv.

donsebo
08-31-2011, 04:13 PM
That sounds to me like a configuration issue, either in your install of FF preventing non-local publishing of the referrer (no clue if this is an actual configuration or can be changed), or the webserver is not registering them.
One thing to check is that it doesn't exist in the $_SERVER super global instead of getenv.

Thanks for your reply! $_SERVER['HTTP_REFERER'] is also not working, But why does IE show all referer info correctly? The thing which I find very strange is that when I try to call phpinfo() there is nothing listed...

Here: http://meinebande.de/php.php

The 1.php and 2.php is here: http://meinebande.de/1.php

Is it working with your firefox/ie browser?

Thanks alot!

donsebo
08-31-2011, 04:58 PM
I got it...

I made a new windows user and there it is working normally with firefox and internet exporer -.-

I still dont know why its not working here, but I will try later with a fresh installation of firefox.

thanks everyone ^^

Fou-Lu
08-31-2011, 07:19 PM
I got it...

I made a new windows user and there it is working normally with firefox and internet exporer -.-

I still dont know why its not working here, but I will try later with a fresh installation of firefox.

thanks everyone ^^

That would indicate that it is a configuration within FF.
IE and FF cannot be compared. Every $_SERVER and $_ENV environment variables have no guarantee to exist in PHP, and a referrer is something requested by the server from your browser. Its up to the browser to determine if it wants to provide that information or not.

tangoforce
08-31-2011, 07:54 PM
You might want to try SeaMonkey instead. It's a mozilla browser made by the same guys that make FireFox. It's supposed to be a better suite of internet tools designed for developers but in reality its still a FF browser with a few extras that has a different brand name. It's far more reliable than FF.. which has a big PR campaign but suffers from quality and performance problems.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum