Discover Habbo's history
Treat yourself with a Secret Santa gift.... of a random Wiki page for you to start exploring Habbo's history!
Happy holidays!
Celebrate with us at Habbox on the hotel, on our Forum and right here!
Join Habbox!
One of us! One of us! Click here to see the roles you could take as part of the Habbox community!


Page 1 of 2 12 LastLast
Results 1 to 10 of 16
  1. #1
    Join Date
    Dec 2006
    Posts
    3,970
    Tokens
    0

    Latest Awards:

    Default Strange, strange problem! [+rep]

    There is a hit counter on every page of my site, and on firefox i knoticed that when i click a link on my site the hit counter goes up 2 times, I can see the page start to load then get repleaced with the page again (it all happens very fast becuase im viewing it on my localhost). But on internet explorer when you click a link the page only loads once. Allso on firefox once i have visited the page once its fine (it only loads once).

    Ive got no javascript on the page or anything like that, its just html and a style sheet, server side theres a mysql database and some of the site info loads from text files. The problem is on every page

    +Rep if anyone knows how to fix it, or whats causing it.

    Thanks.
    Lets set the stage on fire, and hollywood will be jealous.

  2. #2
    Join Date
    May 2008
    Posts
    910
    Tokens
    0

    Default

    Are you using it on multiple tabs? As, it might be reading the active site connections from the refresh. =P

  3. #3
    Join Date
    Dec 2006
    Posts
    3,970
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Joshuae View Post
    Are you using it on multiple tabs? As, it might be reading the active site connections from the refresh. =P
    Nope, just 1 tab, and the hit counter goes up by 2 on firefox so its not displaying the the old copy of the page then waiting to recieve the new one.
    Last edited by Decode; 23-06-2008 at 03:54 PM.
    Lets set the stage on fire, and hollywood will be jealous.

  4. #4
    Join Date
    Sep 2005
    Location
    East London
    Posts
    3,028
    Tokens
    0

    Latest Awards:

    Default

    if u have the counter on 2 pages ie..

    index.php has the counter on it, and then lol.php also has counter on it, therefore when lol.php is included in index.php it counts as two.

  5. #5
    Join Date
    Dec 2006
    Posts
    3,970
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Jackboy View Post
    if u have the counter on 2 pages ie..

    index.php has the counter on it, and then lol.php also has counter on it, therefore when lol.php is included in index.php it counts as two.
    This may be the answer. would it count if i was using this?

    <html>
    <head><title>THIS IS INDEX.PHP</title></head>
    <body>
    <?php
    include("lol.php"); // has hit counter in
    ?>
    </body>
    <html>

    EDIT: just went to the file that the hit counter is included in and refreshed that on firefox and it still did 2 hits, then i did it on ie and it only did 1.

    Thanks for your help anyway +rep
    Last edited by Decode; 23-06-2008 at 04:02 PM.
    Lets set the stage on fire, and hollywood will be jealous.

  6. #6
    Join Date
    Oct 2006
    Location
    Peterborough, UK
    Posts
    3,855
    Tokens
    216

    Latest Awards:

    Default

    Something is doing the hit counter twice, post the hit counter code and I'll take a look.


    visit my internet web site on the internet
    http://dong.engineer/
    it is just videos by bill wurtz videos you have been warned

  7. #7
    Join Date
    Dec 2006
    Posts
    3,970
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by Jewish Bear View Post
    Something is doing the hit counter twice, post the hit counter code and I'll take a look.
    Thats the hit counter code, i thought the same as you, but php is server side so i dont understand how it can happen for firefox but no ie.

    <?php
    $hitcount = "db/hits/" . $pageid . ".txt";
    $hits = file_get_contents("$hitcount");
    $hits = $hits + 1;
    $open = fopen($hitcount , "w");
    fputs($open , "$hits");
    fclose($open);
    echo $hits;
    ?>
    Lets set the stage on fire, and hollywood will be jealous.

  8. #8
    Join Date
    Jul 2007
    Location
    UK
    Posts
    2,470
    Tokens
    2,975

    Latest Awards:

    Default

    im no PHP exper but shout this have +1? $hits = $hits + 1;

  9. #9
    Join Date
    Oct 2006
    Location
    Peterborough, UK
    Posts
    3,855
    Tokens
    216

    Latest Awards:

    Default

    Quote Originally Posted by Tom743 View Post
    Thats the hit counter code, i thought the same as you, but php is server side so i dont understand how it can happen for firefox but no ie.

    <?php
    $hitcount = "db/hits/" . $pageid . ".txt";
    $hits = file_get_contents("$hitcount");
    $hits = $hits + 1;
    $open = fopen($hitcount , "w");
    fputs($open , "$hits");
    fclose($open);
    echo $hits;
    ?>
    That looks fine to me.


    visit my internet web site on the internet
    http://dong.engineer/
    it is just videos by bill wurtz videos you have been warned

  10. #10
    Join Date
    Dec 2006
    Posts
    3,970
    Tokens
    0

    Latest Awards:

    Default

    Quote Originally Posted by 2fast2kwl View Post
    im no PHP exper but shout this have +1? $hits = $hits + 1;
    I dont quite understand what you're saying :S
    Lets set the stage on fire, and hollywood will be jealous.

Page 1 of 2 12 LastLast

Posting Permissions

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