phpretard Posted May 28, 2008 Share Posted May 28, 2008 I have a form that when is completed submits the info into a DB. No problem When the form is complete the header redirects you to a new page. If you click the back button you of course get this page has expired but if you click yes to refresh it resubmits the same infor to the DB. Now I have Duplicate entries with the basically the same info. How could I prevent this issue? Link to comment https://forums.phpfreaks.com/topic/107572-bouble-submision-issues/ Share on other sites More sharing options...
awpti Posted May 28, 2008 Share Posted May 28, 2008 One common way is to submit the info to a popup or just do validate to check for double-submission attempts. Set a session variable that doesn't accept the post data if the user has already sent in the form.. tons of ways. Link to comment https://forums.phpfreaks.com/topic/107572-bouble-submision-issues/#findComment-551398 Share on other sites More sharing options...
haku Posted May 28, 2008 Share Posted May 28, 2008 Use the following pattern: form -> submission page -> page to be forwarded to Have all the processing done on the submission page, with a redirect to the page to be forwarded to at the end. Since all the processing is done on the submission page behind the scenes on the server, the user's history will only show the form page, and the page to be forwarded to. This way when the user clicks back, they go back to the form, and nothign is submitted. Link to comment https://forums.phpfreaks.com/topic/107572-bouble-submision-issues/#findComment-551404 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.