Php prevents repeated submission of forms. I believe you can find many examples on the Internet. Here, I have compiled some common methods for you and hope to help you. Php prevents repeated submission of forms. I believe you can find many examples on the Internet. Here, I have compiled some common methods for you and hope to help you.
Script ec (2); script
When a user submits a form, the same record may be repeatedly inserted into the database due to the speed of the network or the malicious refreshing of the webpage. This is a tricky problem. We can start with the client and the server to avoid repeated submission of the same form.
1. Use client scripts
After you click the submit button, the button becomes unavailable.
In the above example, The OnClick event is used to detect the user's submission status. If you click the submit button, the button is immediately set to invalid. You cannot click the button to submit again.
Another method is to use JavaScript, but the OnSubmit () method is used. If a form has been submitted once, the dialog box is displayed immediately. The Code is as follows: