Jump to content

Double form submitting


Tandem

Recommended Posts

I think i might be havng a problem with forms being submitted twice. At the moment i have a javascript file that removes all submit buttons from a form once one of them has been clicked, so as to stop double submitting.

However i have heard that there is a no-scipt plug-in for firefox and i think that it might be stopping that particular script from working, and leaving my forms open to being double submitted by its users.

I was wondering if there is anything that i can do within php to stop this? And if anyone could suggest any other alternatives too.

Thanks in advance.
Link to comment
https://forums.phpfreaks.com/topic/26621-double-form-submitting/
Share on other sites

PHP is a server side language, javascript is client side.  The two languages essentially operate in different universes and really only share the 'GET' namespace.

No, PHP isn't going to help you here.  The best thing PHP could help with is validation.  I would recommend taking another look at your form and try redesigning it so it submits fast, reducing the chance for a submit button to be pressed twice.
When creating the form you could use PHP to insert a random number into a hidden field. Then when the form is submitted, the page that is processing the submission would check to see if there is a record in the database with that unique ID. Of course, you would need to include that identifier when adding records to the database.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.