Are you wanting a counter to tell you how many times the form has been submitted? You have some options.
One thing you could do is simply use your website stats to see how many times your submission or thankyou page has been loaded. This requires that you submit your form to a specific page or that you redirect the browser after the HTML form is emailed to a specific page.
Another option is to go with your own counter like you are doing now. This could be stored in a database or a file--like you are doing now. Instead of loading the counter and incrementing it on the page that creates the form, do it on the page (or in the code section) that processes the form.
For example:
[HTML]
<form method="post" action="thankyou.php">
<input name="first_name" type="text" />
<input name="last_name" type="text" />
<input name="email" type="text" />
</form>
[/HTML]
thankyou.php[PHP]
<?php
/*
You can access your form variables through $_POST[].
*/
$first_name = $_POST['first_name'];
$last_name = $_POST['last_name'];
$email = $_POST['email'];
/*
Now do your counter thing here. Read in the number, increment it by one
then write it back to the file. You already know how to do that, so I'll not
code it here.
Insert code to email the form results to whoever you want.
*/
?>
<h1>Thank you, <?= $first_name ?>!
[/PHP]
Something like that.