php - yii2 advanced integrates wangEditor, uploading pictures and reporting 400.
PHP中文网
PHP中文网 2017-05-16 13:09:02
0
2
570

yii2 advanced integrates wangEditor and uploads pictures for 400 yuan.
< /p>

< /p>

< /p>

I encountered 400 before saying it was because of csrf, but the hidden field code has been added
<input type="hidden" id="_csrf" name="_csrf-frontend" value="<?php echo yii: :$app->request->csrfToken; ?>" />

PHP中文网
PHP中文网

认证0级讲师

reply all(2)
世界只因有你

Try to disable it when adding public $enableCsrfValidation = false; or init() to the corresponding controller. If it works, it means you wrote the wrong CSRF token hidden field when adding it.

漂亮男人

You can try changing your hidden domain to something like this

<input type="hidden" name="_csrf" value="<?php echo yii::$app->request->csrfToken; ?>" />
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template