I have a webpage with a simple form and some php code to post the data to a mysql database. When I refresh the page, duplicate data is posted to the database. How can I stop this from happening?
1. Reset the form data after it has posted to the script. You can use the header() directive to redirect to a fresh copy of the form.
2. Set a cookie or use sessions to keep track of the fact that the user has posted a specific set of data.
Why is the page still filled in with data? How do you eneter it into MySQL?
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.