Forum Moderators: coopster
--------------------
<?php
$hits = file_get_contents("hits.txt");
$hits = $hits + 1;
$handle = fopen("hits.txt", "w");
fwrite($handle, $hits);
fclose($handle);
echo $hits;
?>
If that doesn't help put error_reporting(E_ALL); at the top of the script to make sure there are no other errors.
You could also try typecasting $hits (see below), but that shouldn't be the issue in PHP.
$hits = (int)file_get_contents("hits.txt");