I have a little simple hit counter. It works if I replace $cnt++;
with #cnt = $cnt + 1;
I can't see why this doesn't work. Any ideas?
if(file_exists( "counter.da t")) {
$f = fopen("counter. dat", "r");
$cnt = fread($f, 10);
//echo "\n", "count 1 = ", $cnt, "\n";
fclose($f);
//$cnt++; DOESN'T WORK!!!
$cnt = $cnt + 1;
//echo "\n", "count 2 = ", $cnt, "\n";
$f = fopen("counter. dat", "w");
fwrite($f, $cnt);
fclose($f);
printf("\n%d people have visited this page\n", $cnt);
}
thanks,
Wilfred
Comment