Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
09-29-2006, 09:40 PM #1
- Join Date
- Nov 2005
- Horsham, West Sussex, UK
- Thanked 1 Time in 1 Post
Submiting a form, and then clicking refresh multiple times to resend the data
On my comments page for a news story on my site...
When users add a comment, they can keep clicking refresh and then enter and it keeps adding their comment over and over again.
How can i disable them from refreshing the page to resend their data?
09-30-2006, 03:13 AM #2
- Join Date
- Feb 2006
- Arizona, USA
- Thanked 0 Times in 0 Posts
You just need to direct them to a new page after submitting the comment. Then refreshing will just refresh the page their on.
The general idea of submitting anything is this:
Begining page -> Click submit
-> data goes to another submit page which imports the data and...
-> sends them back to begining page
So if they are on your article page, say, "article.html", then hit submit which sends data to "process.php", this page then sends them back to article.html with an empty comment form, and their new comment on the top or bottom or whatever you do.
Or, whatever language you're using to submit, when you have a successful submit, destroy the data so it can't be submitted again via refresh.
Hope that helps. I always create a php data processing file that does all my site's submitting, and then sends them back to whatever page they were on.