This is a fairly common problem.
Using method="POST" instead of GET on the form should, in theory, prevent double-submit. The user should be asked if they really want to re-submit the data. Works in Mozilla but not sure about IE. I am pretty sure there are browsers that don't implement this correctly, plus the user may foolishly chose "OK" and re-submit the data, so you need another mechanism.
The usual way to do it is to generate a random unique identifier when you first display the form, and put it in a hidden form field. If a form is submitted more than once with the same identifier, ignore the duplicate submissions. Usually, you'll store the submitted data along with the identifier in a database, then you can check if there is already a record with that identifier before you try to insert the row (you can even use a "unique" constraint on the identifier column to be extra sure). If no database is available (as your mention of writing to a file suggests) another way to do it is to set a cookie on the user's browser to note that the form has already been submitted, although this requires the user to have cookies enabled in order to work.