Php prevents repeated forms and php prevents form submission. Php prevents repeated submission of forms. php prevents users from submitting forms due to the speed of the network or malicious refreshing of webpages, this causes the same record to be inserted to the database repeatedly. php prevents repeated submission of forms, and php prevents form submission.
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
[Php]View plaincopy
-
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:
[Php]View plaincopy