I was wondering what methods/preventions other programmers use to stop data being entered twice into a MySQL database when a user refreshes on the same page as a form? Obvio
You can use a token to prevent the page from being processed again! Such a procedure is used in a lot web frameworks !
The pattern you should use is the "Synchronizer Token Pattern"! If you have a serviceoriented application, you can save your status in the Database.
The data can be send via JavaScript or by a hidden form field.
You should also have a look at libaries with out of the box support for things like this! Grails is such one!
See: http://www.grails.org/1.1-Beta3+Release+Notes ...
...
withForm {
// good request
}.invalidToken {
// bad request
}
..