tidysi Posted August 28, 2007 Share Posted August 28, 2007 My PHP script inserts data into a mysql table that has been passed into it. My question is, what is the general method by which to ensure that if a user reloads the screen, the same set of data doesn't get duplicated into the database? For instance, I am inserting ticket data (its an ecommerce event system) into a mysql and really dont want duplicated entries if the user happens to press reload or back or whatever Any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/67051-stopping-another-data-insert-when-user-reloads-page/ Share on other sites More sharing options...
Jessica Posted August 28, 2007 Share Posted August 28, 2007 After inserting it, use header() to go to a new page. If they refresh that page, it won't insert. Quote Link to comment https://forums.phpfreaks.com/topic/67051-stopping-another-data-insert-when-user-reloads-page/#findComment-336237 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.