deansatch Posted August 19, 2009 Share Posted August 19, 2009 Sometimes, on a slow connection, if someone clicks on a submit button, it inserts the info into the db but as the page is still showing the submit button, the impatient user has another angry click and it inserts the data again before resolving to the thankyou page. Is there a way to stop this happening? And on a similar note, when you have a page with a form on that posts to itself e.g. action="", how can I make it so that refreshing the page doesn't repost? Quote Link to comment https://forums.phpfreaks.com/topic/171007-double-posting/ Share on other sites More sharing options...
mikesta707 Posted August 19, 2009 Share Posted August 19, 2009 It depends. If each of your posts are different from one another, you can do a check to make sure that the data isn't the same before posting it. If not, you can have a column in the array that logs the IP, and check if the IP has submitted data before on that table. You could also check if the very last row submitted is the same as the row thats about to be submit, and exit the script if they are the same Quote Link to comment https://forums.phpfreaks.com/topic/171007-double-posting/#findComment-901911 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.