Skip to main content
Known Participant
April 25, 2008
Question

multiple form submissions - Duplicate Records

  • April 25, 2008
  • 1 reply
  • 329 views
I have a standard form that is 'posted' with a submit button. The program has a validation portion at the head and on re-entry (post-submit) the data is validated and if there are problems it falls back through display page code, otherwise it writes the data to the database and then moves off to a different location (header("Location: prog.php");).... BUT ... if you keep hitting the submit button you end up with duplicate records! before you move on!? Does anyone know hoew to inhibit this multiple submission?
Regards.
Patrick
This topic has been closed for replies.

1 reply

Inspiring
April 25, 2008
So when you hit submit you don't redirect to a different page. One
possibility is to hide the submit button after it is submitted the
first time. The easiest way from my view is just redirect to a
different page.

patricktrAuthor
Known Participant
April 25, 2008
Normally it works fine but if you click the submit button more than once in quick succession this seems to happen .... it's as if there is a time lag between when you click the button and the system recognising the button has been clicked (or rather as the form data is being validated, the submit button is still 'live') so effectively it fires up more than one loop around the code if that makes sense.