$file = fopen("counter.dat","a+"); $counter = fread($file, filesize("counter.dat")); fclose($file); $counter += 1; $file = fopen("counter.dat","w+"); fwrite($file, $counter); fclose($file); include 'counter.dat'; ?>