Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 8 of 8
  1. #1
    New to the CF scene
    Join Date
    Aug 2011
    Posts
    4
    Thanks
    2
    Thanked 0 Times in 0 Posts

    Question Get Refer(r)er Information | FF/IE | Problem | Please help!

    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:
    Code:
    <html>
    	<head>
    	</head>
    	<body>
    		<a href="2.php">Hier gehts weiter</a>
    	</body>
    </html>
    2.php:
    Code:
    <?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 [I know they are bad, but never mind...]) 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, or? Please help me!

    Have a nice day!

  • #2
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,979
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    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.

  • Users who have thanked Fou-Lu for this post:

    donsebo (08-31-2011)

  • #3
    New to the CF scene
    Join Date
    Aug 2011
    Posts
    4
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Fou-Lu View Post
    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!

  • #4
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,979
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    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.

  • Users who have thanked Fou-Lu for this post:

    donsebo (08-31-2011)

  • #5
    New to the CF scene
    Join Date
    Aug 2011
    Posts
    4
    Thanks
    2
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Fou-Lu View Post
    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!
    Last edited by donsebo; 08-31-2011 at 04:16 PM.

  • #6
    New to the CF scene
    Join Date
    Aug 2011
    Posts
    4
    Thanks
    2
    Thanked 0 Times in 0 Posts
    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 ^^

  • #7
    God Emperor Fou-Lu's Avatar
    Join Date
    Sep 2002
    Location
    Saskatoon, Saskatchewan
    Posts
    16,979
    Thanks
    4
    Thanked 2,659 Times in 2,628 Posts
    Quote Originally Posted by donsebo View Post
    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.

  • #8
    Senior Coder
    Join Date
    Feb 2011
    Location
    Your Monitor
    Posts
    4,091
    Thanks
    51
    Thanked 506 Times in 493 Posts
    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.
    My helpful sig is on vacation trying to loose some weight. It got a bit fat and caused a few problems but it will be back at some point!


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •