metulj (26-12-10)
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.
Perfection comes at a cost
I accept liberty!
metulj (26-12-10)
Maybe it can be used in any directory with:
It should but im didn't try it...PHP Code:$logs=($_SERVER['DOCUMENT_ROOT']."logs.dat");
<!DOCTYPE html PUBLIC "-//WAPFORUM.RS
I know that. I didn't just bother with it as I didn't use it myself.Originally Posted by arnages [Only registered and activated users can see links. Click Here To Register...]
I minified it so I didn't bother reading through the code before posting.
Don't forget hits.dat
U have pm.![]()
<!DOCTYPE html PUBLIC "-//WAPFORUM.RS
this should count hits separatelly daily, weekly, monthly ??Originally Posted by frostymarvelous [Only registered and activated users can see links. Click Here To Register...]
if so, then it doesnt work correctly...
btw coding in one line is really ugly...
still thanks for sharing
キノgんイノ刀g 4 ア乇ムc乇 ノ丂 レノズ乇 キucズノ刀g 4 √ノ尺gノ刀ノイリ!It's better to keep your mouth shut and give the impression that you're stupid, than to open it and remove all doubt.
ⓣⓗⓔ ⓠⓤⓘⓔⓣⓔⓡ ⓨⓞⓤ ⓑⓔ©ⓞⓜⓔ, ⓣⓗⓔ ⓜⓞⓡⓔ ⓨⓞⓤ ⓐⓡⓔ ⓐⓑⓛⓔ ⓣⓞ ⓗⓔⓐⓡ !
ιη тнєσяу, тнє ρяα¢тι¢є ιѕ α яєѕυℓт σƒ тнє тнєσяу, вυт ιη ρяα¢тι¢є ιѕ тнє σρρσѕιтє.
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.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks