Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Browser Refresh Adds Duplicate Data

Status
Not open for further replies.

gogirl

MIS
Joined
Jun 5, 2002
Messages
46
Location
US
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?

Thanks,

gogirl
 
There are several things to think about:

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?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top