I have a simple form that submits text to my SQL table. The problem is that after the user submits the text, they can refresh the page and the data gets submitted again with
Why not just use the $_POST['submit']
variable as a logical statement in order to save whatever is in the form. You can always redirect to the same page (In case they refresh, and when they hit go back
in the browser, the submit post variable wouldn't be set anymore. Just make sure your submit button has a name
and id
of submit
.