prova così (fatto velocemente, ci sarà qualche errore):
<?
// formato contatore: contatore|giorno
$filename = "contatore.txt";
$handle = fopen($filename, "r");
$contents = fread($handle, filesize($filename));
fclose($handle);
list($contatore, $giorno) = split(['|'], $contents);
$data = getdate();
$oggi = $data['mday'];
if($oggi == $giorno)
$contatore++;
else
$contatore = 1;
$handle = fopen($filename, "w+");
fwrite($handle, "$contatore|$oggi");
close($handle);
?>


Rispondi quotando