non sono una esperta ma penso che puoi creare un contatore in questa maniera:

[PHP]
<?php
//counter.txt deve essere creato e contenere 0
if (!file_exists("counter.txt"))
{
$file = fopen("counter.txt","w+");
$num = 0;
}
else {
$file = fopen ("counter.txt","r+");
$num = fgets($file,20);
fseek ($file,0);
}
$num++;

echo "Questa pagina è stata visitato: $num";
fputs($file,$num);
fclose ($file);
?>

[PHP]