Invisible hit counter in php

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ghjk
    Contributor
    • Jan 2008
    • 250

    #1

    Invisible hit counter in php

    I want to put invisible hit counter to multiple pages of web site. I put visible counter like follow. There is a text file which is use to save counts. and there is a php file including the following code.And finally I put echo
    Code:
    echo $hits[0];
    to display the hits. Now I want to invisible these hits and also add to multiple pages. Surf the internet and didn't find a answer to my problem. Could some one plese help me...

    counter.php
    Code:
    $count_my_page = ("hitcounter.txt");
    $hits = file($count_my_page);
    $hits[0] ++;
    $fp = fopen($count_my_page , "w");
    fputs($fp , "$hits[0]");
    fclose($fp);
  • Dormilich
    Recognized Expert Expert
    • Aug 2008
    • 8694

    #2
    what about just not doing the echo?

    Comment

    • ghjk
      Contributor
      • Jan 2008
      • 250

      #3
      But then admin have to access the web folder to check it.

      Comment

      • Dormilich
        Recognized Expert Expert
        • Aug 2008
        • 8694

        #4
        what else is the purpose of an invisible counter?

        Comment

        • ghjk
          Contributor
          • Jan 2008
          • 250

          #5
          only admin should see it. I found the solution. just I check the access level and show the hit counter.

          Comment

          Working...