Skip to main content.
Image counter

The counter is fairly simple, it reads in a specified counter file, increments the count within the file, writes out the new value and outputs an image file with the new value displayed. It also takes some parameters for background and foreground colour, or these can be left at default values (black on white) if you prefer.

It uses PHP, and the GD library extensions to PHP

It is released under the GPL Version 2

Only parameter on the actual link should be a count=<directory name>. This directory should contain a count.conf file, with a minimum content of just a "filename=" line to indicate the filename to store count data in, but can have the other parameters in as well.

e.g. http://www.bits.bris.ac.uk/palfrey/utils/counter.php3?conf=count

Parameters (for count.conf file, in form "name=value"):
NameExample ValueNotes
filenamecount.datOnly necessary parameter
bcolourffffffHex value, same as html colours for the background (Default: ffffff)
fcolour000000Same as bcolour, but for foreground colour (Default:000000)
hostshosts.txtFile to store the list of hosts that have accessed this counter, with individualized page counts
dont_count137.222.209.41Your IP, to avoid being counted when you check your own page.... you're still counted in the hosts file.


Download the code here

Example count.conf file


Return to the Code Page
  Page by Tom Parker <palf...@tevp.net>
This page was last updated on 13/11/2007 at 08:44:23 and has had a finite number of hits.
Listening to: Buzzcocks - Lipstick
Clone TANKS. Food VATS. Don't mix them up!
FOAF Get FirefoxValid XHTML 1.0!