Jump to content
Larry Ullman's Book Forums

Recommended Posts

Duplicate form submission is something that is really bugging me, ive seen this problem happening on some major php websites. Where someone will submit a form and maybe double click the submit button or click it multiple times, therefore we end up with multiple records in the database. Ive also seen this happening when people either reload the page after submitting by clicking the browers back button.

 

I am aware if you are in using javascript with your forms that you can get around this problem by disabling the button elements after an onclick event, but on the other hand if the user has javascript disabled in their options it will still happen. I have seen in the O'rielly Php Cookbook a method they use where you can add a token into an sql lite database and then recall the value to see if the token was already submitted.

 

So Larry and others here, how do you handle such problems on website with multiple transactions. And Larry, this would be something very useful for people useful if added to a later addition of this book.

Link to comment
Share on other sites

Its a big book, i haven't seen it yet or mentioned in the Index. It's just when i was working through the Knowledge is Power Site i did get some duplicate database records with it, so thought it was something that wasn't covered, ill keep my out for it. Thanks for your help! Keep up your good work!

Link to comment
Share on other sites

  • 2 months later...

Does the double submission on form's error only occur when a script is passed back to itself? So i mean if we submit the forum to a new script we would avoid this kind of error? I have read through your book but haven't noticed this being mentioned anywhere. There is a lot of talk online about disabling the submit button using js, but i wanted to know why this happened and what the php solution for this was.

Link to comment
Share on other sites

  • 3 weeks later...

Well it looks like i will have to learn the hard way on this submission errors. The problem with some of your scripts also was when i clicked on the browser back button we had an expired document page appearing which wouldn't look to great on the real website. I'll do what testing i can and see what i can find out, i am running my stuff live at the moment. Looking forward to getting that advanced book you have finished by the end of this year. At least Walking dead Season 3 will be out at the same time as its due out, so when we are stressed we have something to calm us.

Link to comment
Share on other sites

 Share

×
×
  • Create New...