Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    Regular Coder Andy92's Avatar
    Join Date
    Nov 2005
    Location
    Horsham, West Sussex, UK
    Posts
    363
    Thanks
    7
    Thanked 1 Time in 1 Post

    Submiting a form, and then clicking refresh multiple times to resend the data

    Hi there,

    On my comments page for a news story on my site...

    http://www.allsortshop.com/about/new...cle.php?read=5

    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?


  • #2
    New Coder
    Join Date
    Feb 2006
    Location
    Arizona, USA
    Posts
    74
    Thanks
    0
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •