Results 1 to 6 of 6

Thread: visitor hits counter

  1. #1
    Senior Member frostymarvelous's Avatar
    Join Date
    Jun 2010
    Location
    Accra, Ghana.
    Posts
    258
    Thanks
    3
    Thanked 20 Times in 17 Posts
    Rep Power
    3

    Default 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 Attached Files
    Perfection comes at a cost



    I accept liberty!

  2. The Following User Says Thank You to frostymarvelous For This Useful Post:

    metulj (26-12-10)

  3. #2
    Moderator arnage's Avatar
    Join Date
    May 2009
    Location
    Serbia
    Posts
    707
    Thanks
    165
    Thanked 181 Times in 79 Posts
    Rep Power
    5

    Default

    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

  4. #3
    Senior Member frostymarvelous's Avatar
    Join Date
    Jun 2010
    Location
    Accra, Ghana.
    Posts
    258
    Thanks
    3
    Thanked 20 Times in 17 Posts
    Rep Power
    3

    Default

    Quote Originally Posted by arnages [Only registered and activated users can see links. Click Here To Register...]
    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

  5. #4
    Moderator arnage's Avatar
    Join Date
    May 2009
    Location
    Serbia
    Posts
    707
    Thanks
    165
    Thanked 181 Times in 79 Posts
    Rep Power
    5

    Default

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

  6. #5
    Super Moderator metulj's Avatar
    Join Date
    Jan 2007
    Location
    your root... now think fast... =]
    Posts
    1,708
    Thanks
    558
    Thanked 212 Times in 130 Posts
    Rep Power
    0

    Default

    Quote Originally Posted by frostymarvelous [Only registered and activated users can see links. Click Here To Register...]
    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ノ刀ノイリ!

  7. #6
    Senior Member frostymarvelous's Avatar
    Join Date
    Jun 2010
    Location
    Accra, Ghana.
    Posts
    258
    Thanks
    3
    Thanked 20 Times in 17 Posts
    Rep Power
    3

    Default

    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.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Get More Visitor
    By djmob in forum Sites / Links
    Replies: 1
    Last Post: 12-09-10, 12:17
  2. Very simple hits counter
    By GumSlone in forum Snippets, Functions and Classes
    Replies: 4
    Last Post: 04-03-10, 14:48
  3. Image Hits Counter With Database Help
    By Phpnewb in forum Site / Script testing and error fixing
    Replies: 2
    Last Post: 22-08-08, 00:05
  4. Hits Counter
    By tzoulija in forum Coding Forum
    Replies: 11
    Last Post: 20-09-07, 11:00

Tags for this Thread

Bookmarks

Posting Permissions

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

SEO by vBSEO

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19