Buongiorno a tutti

avrei un piccolissimo probelma con un contatore, diciamo che la sua funzione la svolge abbastanza bene, solo che mi conta anche l'aggiornamento della pagina, c'è un modo per farsì che ciò non accada??

Di seguito il codice:


<?
if (!$hitsfile) $hitsfile = dirname(__FILE__)."/hits";
if (!$images) $images = dirname(__FILE__)."/images";
$images = str_replace($DOCUMENT_ROOT, "", $images);

$hits = file($hitsfile);
$hits = $hits[0] + 1;

# Opening the hits file and writing the number of hits:
$fp = fopen($hitsfile, "w");
fwrite($fp, $hits);

if ($invisible != "yes") {
# Text counter
if ($counterstyle == "text") {
echo $hits;
}

# Image counter
else {
$digit = strval($hits);
for ($i = 0; $i < strlen($hits); $i++) {
echo "<img src=$images/$digit[$i].gif height=$height width=$width alt=$hits>";
}
}
}
?>