Hit Me Baby
As you might have discovered (if you have Java-Script enabled), there has been a hit-counter at the end of the sidebar for some days now. Some time ago, I was looking for a free text-counter, but didn't find any and since I didn't want a graphical counter I wrote my own PHP-based one.
The invocation is quite funny: since I didn't figure out a way to execute remote PHP scripts non-interactively from within a HTML page in the browser (is there any?), the browser now thinks it downloads an external Java-Script file, which it wants to execute. This is why a Java-Script enabled browser is required to invoke the counter. But instead of downloading a static Java-Script file, the actual counter.php script is remotely executed, which dynamically creates the requested Java-Script. The created Java-Script consists only of a lousy document.write($content); line, while the $content is computed by the counter.php script. Got it? ;)
The text-counter has some nice features:
- The counter is per-site/per-referer based, so you have a different counter for each of your HTML files.
- The output is completely configurable via key=value pairs, which you append to the counter's URL.
- The counter supports multiple users with their own counter file.
0 Comments:
Post a Comment
<< Home