if (isset($_POST['submit'])) {
if (!file_exists('count.txt')) {
$cnt = 1;
$f = fopen('count.txt', 'w+');
fwrite($f, $cnt);
fclose($f);
} else {
$f = fopen('count.txt', 'r');
$cnt = (int) fgets($f);
fclose($f);
$cnt++;
$f = fopen('count.txt', 'w+');
fwrite($f, $cnt);
fclose($f);
}