Php prevents repeated submission of problem summary
Source: Internet
Author: User
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 the client script to mention... "/> <scripttype =" text/javascript "src =" http: // www.2cto. 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. when using client scripts to mention client scripts, JavaScript is often used for regular input verification. In the following example, we use it to process repeated submission of forms. please refer to the following code: After you click the submit button, the button will become unavailable in gray, 5-6. 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:
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.
A Free Trial That Lets You Build Big!
Start building with 50+ products and up to 12 months usage for Elastic Compute Service