Here's the code for the hit counter you no longer see on the left (I adapted this from an example on the Freeola site). The writecounter function updates the hit count, the showcounter function displays the hit count. I've changed it slightly so you'll have to create the file "hits" before using it. It seems to reset itself occasionally, not sure why
<?
function showcounter()
{
print ("<p style=\"margin-top: 0; margin-bottom: 0\"> <font face=\"Arial\" size=\"1\">");
$hitsfile = dirname(__FILE__)."/hits";
if(file_exists($hitsfile) == TRUE)
{
$hits = file($hitsfile);
$hits = $hits[0];
echo $hits;
print (" visitors since May 2002");
print ("</font> </p>");
}
}
function writecounter()
{
$hitsfile = dirname(__FILE__)."/hits";
if(file_exists($hitsfile) == TRUE)
{
$hits = file($hitsfile);
$hits = $hits[0] + 1;
$fp = fopen($hitsfile, "w");
if($fp)
{
fwrite($fp, $hits);
}
}
}
?>