visitor hits counter

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

    visitor hits counter

    Lol. I just found a snippet I coded when just when I started to code php.
    Actually it was originally by vaneesv of spytrick.tk, but I reworked it be almost all me, but still it was his idea first so, I Give credit.


    This counts hits. It doesn't count hits of visitors who reload the page. It actually checks for if the visitor has been online less than 10 minutes and doesn't add hits from them.

    How to use:
    just include the file in your page where you want hits to appear. That's all.

    Known bugs:
    Upon inclusion, first user is counted twice.
    Was a workaround to an earlier bug.
    Can only be used on a single page in a given directory else counts for all pages will accumulate.
    I never used it so I never had reason to correct this so it worked for different pages.

    Requirement:
    Does not use sql but might need write access since it creates two .data files for data storage.

    If you want to use this, you may only remove the tiny credit after at least 14 days of use.
    Attached Files
    Perfection comes at a cost



    I accept liberty!

    #2
    Maybe it can be used in any directory with:

    PHP Code:
    $logs=($_SERVER['DOCUMENT_ROOT']."logs.dat"); 
    It should but im didn't try it...
    <!DOCTYPE html PUBLIC "-//WAPFORUM.RS

    Comment


      #3
      Originally posted by arnages View Post
      Maybe it can be used in any directory with:

      PHP Code:
      $logs=($_SERVER['DOCUMENT_ROOT']."logs.dat"); 
      It should but im didn't try it...
      I know that. I didn't just bother with it as I didn't use it myself.
      I minified it so I didn't bother reading through the code before posting.

      Don't forget hits.dat
      Perfection comes at a cost



      I accept liberty!

      Comment


        #4
        U have pm.
        <!DOCTYPE html PUBLIC "-//WAPFORUM.RS

        Comment


          #5
          Originally posted by frostymarvelous View Post
          Lol. I just found a snippet I coded when just when I started to code php.
          Actually it was originally by vaneesv of spytrick.tk, but I reworked it be almost all me, but still it was his idea first so, I Give credit.
          This counts hits. It doesn't count hits of visitors who reload the page. It actually checks for if the visitor has been online less than 10 minutes and doesn't add hits from them.
          How to use:
          just include the file in your page where you want hits to appear. That's all.
          Known bugs:
          Upon inclusion, first user is counted twice.
          Was a workaround to an earlier bug.
          Can only be used on a single page in a given directory else counts for all pages will accumulate.
          I never used it so I never had reason to correct this so it worked for different pages.
          Requirement:
          Does not use sql but might need write access since it creates two .data files for data storage.
          If you want to use this, you may only remove the tiny credit after at least 14 days of use.
          this should count hits separatelly daily, weekly, monthly ??
          if so, then it doesnt work correctly...
          btw coding in one line is really ugly...
          still thanks for sharing
          It's better to keep your mouth shut and give the impression that you're stupid, than to open it and remove all doubt.
          ⓣⓗⓔ ⓠⓤⓘⓔⓣⓔⓡ ⓨⓞⓤ ⓑⓔ©ⓞⓜⓔ, ⓣⓗⓔ ⓜⓞⓡⓔ ⓨⓞⓤ ⓐⓡⓔ ⓐⓑⓛⓔ ⓣⓞ ⓗⓔⓐⓡ !
          ιη тнєσяу, тнє ρяα¢тι¢є ιѕ α яєѕυℓт σƒ тнє тнєσяу, вυт ιη ρяα¢тι¢є ιѕ тнє σρρσѕιтє.
          キノgんイノ刀g 4 ア乇ムc乇 ノ丂 レノズ乇 キucズノ刀g 4 √ノ尺gノ刀ノイリ!

          Comment


            #6
            It works correctly.
            The reason it shows all of them with the same hits is cos its still the same day. If you use a local server, try changing the date on your pc in daily, weekly, and monthly increments. You will see it change.

            I didn't code it one line. I made it that way after coding.
            Perfection comes at a cost



            I accept liberty!

            Comment

            Working...
            X