nah you need to do stuff in this order
fopen with r parameter to read it
fread it
store in a variable
fclose
fopen again with w parameter to clear it and prepare it for writing
add 1 to the variable
fwrite
and then echo it
code:
<?
$counter = fopen("counter.txt", "r");
$blah = fread($counter, filesize("counter.txt"));
fclose($counter);
$counter = fopen("counter.txt", "w");
$blah = $blah + 1; //not sure if $blah++ would work, try it
fwrite($counter, $blah);
fclose($counter);
echo $blah;
?>