Form tokens Prevent duplicate submissions

Source: Internet
Author: User

Some people say TOKEN in 3.2 can not be used, the study of a bit, I hope to help everyone.
Not normal cause:
The original tags.php was migrated to the following file
thinkphp\mode\common.php
And in:
' Template_filter ' = Array (
' Behavior\contentreplacebehavior ',//template output replacement
),
Only one action was added, compared with 3.1 less tokenbuildbehavior
So
Method 1: As soon as we create the tags.php file in application\common\conf
Join:
Return Array (
' View_filter ' = Array (
' Behavior\tokenbuildbehavior ',//form token
),
);
Method 2: Join in thinkphp\mode\common.php
' Behavior\tokenbuildbehavior ',//form token

' Config item ' = ' config value '
' View_filter ' = = Array (' Behavior\tokenbuildbehavior '),
' token_on ' + true,//whether turn on token validation is off 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 verification is performed automatically when create

    1. If (! Autochecktoken, $User($_post)) {
    2. //token validation error
    3. Manual Form Validation
      1. C(' token_on ',false); Cancel form validation

Form tokens Prevent duplicate submissions

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.