search

Home  >  Q&A  >  body text

php - yii2 advanced integrates wangEditor, uploading pictures and reporting 400.

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中文网2740 days ago532

reply all(2)I'll reply

  • 世界只因有你

    世界只因有你2017-05-16 13:11:02

    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.

    reply
    0
  • 漂亮男人

    漂亮男人2017-05-16 13:11:02

    You can try changing your hidden domain to something like this

    <input type="hidden" name="_csrf" value="<?php echo yii::$app->request->csrfToken; ?>" />

    reply
    0
  • Cancelreply