Note: You will need to find some digits from somehere, name them as 0.gif, 1.gif, 2.gif etc. The
counter logs hits only, there is no support for cookies or host logging in this version. For
updates and images check http://www.iptoolz.com/
To get it to work, simpy modify the code bellow this paragraph where appropriate and upload
to your server. Then on php3 pages which you want the counter to appear, use <? include
("script location"); ?>
<?
///////////////////////////////////////////////////////////////////////////////////
//| A really simple HitCounter, written in PHP3 | Free for non commercial use only
//--------------------------------------------------------------------------------
//| Coded by Steven @ Not Applicable Foundation | Distributed with NO Warranty of
//| (Whilst all normal people were eating lunch, | any kind. Use at your own risk.
//| this header took longer than the code :) | Please do not modify this header.
//---------------------------------------------------------------------------------
//| Made because the one i downloaded and was using before broke after 38,000 hits!
//| Also this one outputs alt tags containing the hit number, so that people whose
//| browsers don't display pictures can see the hit count.
//---------------------------------------------------------------------------------
//| Change this to the location of the file containing hits. File must be readable
//| and writable. Create if necessary, adding a start number (0?).
//|
$fileloc = "/home/mysite/hits.txt";
//|
//| Change this to the url directory containing the images, including trailing /
//|
$imagedir = "http://www.mysite.com/images/";
//|
//| If the counter is broken, or there is a problem, it will display nothing unless you set this to 1
//|
Patrick Mueller wrote :253
Hi,
i think it`s not necessary to open the counter-file again,
because a few lines before the script already has the value.
This should save some time.
Anonymous Steven wrote :257
yeh you`re absolutely right, if i rewrote it i would use w+
and just use fgets, but as i said, i wrote both it and a
host counter during my lunch hour cause the old one
died. It works with no problems and the time difference
isn`t noticable. It`s such a simple script that i would
hope anyone who downloads it would do it for learning
as opposed to "i have no clue how to make one myself,
i think i`ll use this". When i get my site running i`ll do
some proper scripts for download.