prevent browser refresh from submitting form code example
Example 1: prevent form resubmission on refresh
<script>
if ( window.history.replaceState ) {
window.history.replaceState( null, null, window.location.href );
}
</script>
Example 2: resubmit on refresh php
<script>
if ( window.history.replaceState ) {
window.history.replaceState( null, null, window.location.href );
}
</script>