arpowers Posted October 22, 2007 Share Posted October 22, 2007 Hey guys! I am creating a messaging system where I add a message to the DB through $_POST data.. I'm wondering how I can prevent the data from being resubmitted if the user refreshes the page? any suggestions would be useful! as always, thanks in advance:) Andrew Quote Link to comment https://forums.phpfreaks.com/topic/74271-preventing-the-reprocessing-of-_post-data/ Share on other sites More sharing options...
~n[EO]n~ Posted October 22, 2007 Share Posted October 22, 2007 After submitting in DB, clear your form field and validate so it doesn't allow blank values. Quote Link to comment https://forums.phpfreaks.com/topic/74271-preventing-the-reprocessing-of-_post-data/#findComment-375248 Share on other sites More sharing options...
tibberous Posted October 22, 2007 Share Posted October 22, 2007 Only way I have ever found it do this is a key checkout system. Basically, you have a checkout table, and when you give the user the form, you create a key for them in the table, and write it out in the form as a hidden input. When they submit the form, check and make sure the key they gave you is in the table. If it is, delete it and process the form, otherwise, they have to refresh the blank form to get a new key issued. Little bit of a pain in the ass, works good though. Quote Link to comment https://forums.phpfreaks.com/topic/74271-preventing-the-reprocessing-of-_post-data/#findComment-375252 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.