Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

multiple form submissions - Duplicate Records

New Here ,
Apr 25, 2008 Apr 25, 2008
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
TOPICS
Server side applications
330
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 25, 2008 Apr 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.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Apr 25, 2008 Apr 25, 2008
LATEST
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.
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines