thinkphp form Tokens

Source: Internet
Author: User

Form Tokens

Thinkphp supports form token validation, which effectively prevents the form from being repeatedly submitted for security protection. To enable the form token feature, you need to configure the behavior binding,

In the behavior definition file tags.php below the configuration directory of the application or module

is in your

Or create a tags.php in your project directory configuration file (conf)

The code inside the tags.php file

  return Array (        / / Add the following line definition can        //' view_filter ' = = Array (' Behavior\tokenbuild '),        // If it is 3.2.1 or later needs to be changed to        array(' Behavior\tokenbuildbehavior ');

And then add it to your profile "config.php".

    ' token_on '      +    true,  //  whether to turn on token validation by default    ' token_name '    = ' _ '    _ _hash__ ',    //  Token-validated form hidden field name, default to __hash__    ' token_type ' = '    MD5 ',  / / token hash Validation rule defaults to MD5    ' token_reset '   = =    true,  //  Reset token defaults to true after token validation error

And then it worked.

Details Enter: Http://document.thinkphp.cn/manual_3_2.html#form_token

thinkphp form Tokens

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.