Atomic Hit Counter

PHP Atomic Hit Counter

The hit counter is a trivial function in PHP 4/5 for use with MySQL. There is a couple of demo pages in the project and the source itself is very easy to configure.

Why bother? It's trivial

Yes, yes it is… but this version contains the correct magic incantations to be fast and atomic, without the need for explicit use of database or row locks.

Source Code

Browse the source or check it out:

svn checkout http://svn.tepic.co.uk/svn/tools/hitcounter

Example Use

require_once "hitcounter.php"; echo "<p>Hit count for this page is: ", GetHitCount(), "</p>\n";