Web Analytics Made Easy -
StatCounter Get Refer(r)er Information | FF/IE | Problem | Please help! - CodingForum

Announcement

Collapse
No announcement yet.

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

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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
    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.
    PHP Code:
    header('HTTP/1.1 420 Enhance Your Calm'); 
    Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

    Comment


    • #3
      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!

      Comment


      • #4
        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.
        PHP Code:
        header('HTTP/1.1 420 Enhance Your Calm'); 
        Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

        Comment


        • #5
          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; Aug 31, 2011, 11:16 AM.

          Comment


          • #6
            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 ^^

            Comment


            • #7
              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.
              PHP Code:
              header('HTTP/1.1 420 Enhance Your Calm'); 
              Been gone for a few months, and haven't programmed in that long of a time. Meh, I'll wing it ;)

              Comment


              • #8
                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.
                "Tango says double quotes with a single ( ' ) quote in the middle"
                '$Name says single quotes with a double ( " ) quote in the middle'
                "Tango says double quotes ( \" ) must escape a double quote"
                '$Name single quotes ( \' ) must escape a single quote'

                Comment

                Working...
                X
                😀
                🥰
                🤢
                😎
                😡
                👍
                👎