Can you check the REFERER environment variable?
I would guess that if the REFERER is the form, go ahead and update the text file, but if the REFERER is blank (refresh), don't update the text file.
The referrer is a notoriously unreliable source of information. Many clients don't send one, sometimes it's filtered out by proxies, occasionally it's even faked up from other criteria (like the requested URL). It's user-supplied data, and as such shouldn't be trusted any more than any other data.