Preventing webmasters from submitting a form is nothing more than adding a token to each open form or submit data for verification. this is actually no different from the verification code, the following are several examples of preventing remote form submission outside the site. example 1: Every time we open the submit page, we generate... preventing webmasters from submitting a form is nothing more than adding a token to each open form or submit data for verification. this is actually no different from the verification code, the following are several examples of preventing remote form submission outside the site.
Example 1: Each time we open the submit page, a token is generated and saved in the session. when the form is submitted, we can determine whether the current token value is consistent with the session value, if yes, the request is submitted normally. Otherwise, the request is submitted invalid.
The PHP instance code is as follows:
Another obvious method is to use the verification code, which is the same as other methods. let's look at a simple example below.
Add verification code:The verification code is added when the form is submitted, which can effectively prevent the filling machine from submitting data. However, as the graphic image recognition program becomes more powerful, the verification code recognition is constantly improving its difficulty, some verification codes even include voice recognition. some small sites can adopt this method. the code is as follows:
If ($ _ POST ['vcode']! = Get_vcode ())
{
Exit ('verification code verification failed, unable to warehouse receiving ');
}
For specific examples, we will not introduce many online verification examples.
Address:
Reprinted at will, but please attach the article address :-)