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
- If (! Autochecktoken, $User($_post)) {
- //token validation error
- Manual Form Validation
-
- C(' token_on ',false); Cancel form validation
Form tokens Prevent duplicate submissions