L
L
lexys2612016-05-04 17:56:27
Yii
lexys261, 2016-05-04 17:56:27

Authorization for yii2 basic template not working?

no matter how I try to write form processing, it gives an error 400, for verification, I just drove in an introductory form from the documentation with processing, it still gives an error 49e381a0dd4944a5b43bc1d4831bd2a9.png
<? php
tell me what can be done

Answer the question

In order to leave comments, you need to log in

2 answer(s)
L
lexys261, 2016-05-04
@lexys261

By the way, this is what the debugger says:
exception 'yii\web\BadRequestHttpException' with message 'Unable to verify your data submission.' in D:\wamp64\www\basic\vendor\yiisoft\yii2\web\Controller.php:111
Stack trace:
#0 D:\wamp64\www\basic\vendor\yiisoft\yii2\base\Controller.php(152 ): yii\web\Controller->beforeAction(Object(yii\base\InlineAction))
#1 D:\wamp64\www\basic\vendor\yiisoft\yii2\base\Module.php(454): yii\base\ Controller->runAction('entry', Array)
#2 D:\wamp64\www\basic\vendor\yiisoft\yii2\web\Application.php(84): yii\base\Module->runAction('site/entry ', Array)
#3 D:\wamp64\www\basic\vendor\yiisoft\yii2\base\Application.php(375): yii\web\Application->handleRequest(Object(yii\web\Request))
#4 D:\wamp64\www\basic\web\index.php(12): yii\base\Application->run()
#5 {main}

M
metallix, 2016-05-05
@metallix

If you created the form manually, check if you forgot CSRF.
Something like this in the form should be -

<input type="hidden" name="_csrf" value="<?=Yii::$app->request->getCsrfToken()?> ">

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question