Codeigniter - prevent double submit

do Codeigniter 3.0.0 preventing double submit automatically or not? Is there a helper / library for this? I looked at the form validation and the form helper, but there is nothing there.

Many thanks.

+3


source to share


1 answer


No, CI 3 does not handle double form submissions. What you need to do is submit your page and redirect to another after successful submission.

Now let's say your user clicks two or three times because maybe his mouse isn't working correctly, or his connection is too slow ... then you can also put the code in the form and if the form is submitted then save this code with its timestamp and prevent future submission for that code.



Periodically using cron you can delete saved form codes that are older than 1 minute.

Hope it helps.

0


source







All Articles