不想用gii的表单自己写表单,但是又遇到了400错误,怎么解决?下面为你解答一下:

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAABTsAAAFiCAIAAAC25pstAAAgAElEQVR4nO3d3Y8d5YEn4Fzu3+EbbnIx6FxAy2NBs4wHD2sWE4Q3nSyk8wFjWbMt5GZDY6sNZmbixTjxpsFgdQ7qZSUklDgSm1irBAmlBVZChAcRKwSyhGa0shQJz6KMNaMWI9R7cbq+661Tp09199vmefS7wKerTr310ah/p+pUfWEXAAAAEJ8vbPcAAAAAgBoaOwAAAMRIYwcAAIAYaewAAAAQI40dAAAAYqSxAwAAQIw0dgAAAIiRxg4AAAAx0tgBAAAgRho7AAAAxEhjBwAAgBhp7AAAABAjjR0AAABipLF36f75fr/f7/ef/NaN1R/eMXO63+/3+/P3b/Ddv7j360eefOqZ5xf7/X5/8flnnjp++L7dN4w1YAAAuPnmm7d7CCPb8Jh34sryeaaxdylp7HWVPSnsG2vsX9w/89S5fn9x4eSxmQenp6cfnDl2cmGx3188NXOn0g4AULZ/tn9yOl/Nbp4+2Z/dv23jGcvN0yf7/dLo98+WX9n4exe31ObZP9vPjLHQDY9561a2sKrZfqocljtPV9vwOtgUW0Rj79L98/1+//Tp0zWV/Y6Z0/0zZ85srLHfNP34c/3+2fnpwin1G2578Mnn+v2zcwd1dgCAouupse+f7fdPniz1pJ3W2G+ePlkY8P7ZyocQI71XzI29uG/Ka77DbeVHPOzapbF36/75fr8/PzNTrex3HTnTPz0zM5809ruOnOn3T8/ckZ/m7kcW+ovz91fr911HzvT7zz325epPbj38neef+W//5T+s//OG3fcdPv7U2XP9fr9/7uxTxw9/6aZkyjtmTvf789O3TR99+vnFfr9/7vsnZr50064v7j984szzi/3+4vNPH52+7YbaiRefP3NipnAB/k1fOnw8uT6/f+7sd0/MpEvK5h0MZPH5M+lPR1prAIAxNDf2wUnr4qneQROZns3Oi+6frZwjrZtxC1alP7u/XJT2z/b7s9PpcPKNsHaQxRa5/q/clJtbKetq3v7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ESGMHAACAGGnsAAAAECONHQAAAGKksQMAAECMNHYAAACIkcYOAAAAMdLYAQAAIEYaOwAAAMRIYwcAAIAYaewAAAAQI40dAAAAYqSxAwAAQIw0dgAAAIiRxg4AAAAx0tgBAAAgRho7AAAAxEhjBwAAgBhp7AAAABAjjR0AAABipLEDAABAjDR2AAAAiJHGDgAAADHS2AEAACBGGjsAAADESGMHAACAGGnsAAAAECONHQAAAGKksQMAAECMNHYAAACIkcYOAAAAMdLYAQAAIEYaOwAAAMRIYwcAAIAYaewAAAAQI40dAAAAYqSxAwAAQIw0dgAAAIiRxg4AAAAx0tgBAAAgRho7AAAAxEhjBwAAgBhp7AAAABAjjR0AAABipLEDAABAjDR2AAAAiJHGDgAAADHS2AEAACBGGjsAAADESGMHAACAGGnsAAAAECONHQAAAGKksQMAAECM/j+l+1tAntl/DwAAAABJRU5ErkJggg==" alt="" />

提交表单报400错误,提示 “您提交的数据无法验证”,原来是csrf验证的问题,因为表单是自己写的,在Yii框架中,为了防止csrf攻击,对post的表单数据封装了CSRF令牌验证。
解决办法关闭csrf验证

方法一、在配资文件中关闭

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAA1gAAACOCAIAAACjcj5QAAAO9ElEQVR4nO3dP0sc2x8H4H05Ymdh6WsQy1uIdVrtUggXNq/gCrsXKytRSJplIbF0CwvlcsdYXEjuNXYXQhi4EH7BEPIr9t+Z2TO7s3+MWed52EJPZs6cmQ344XvmzNS+f//+9evXf/755+3bt1cAADx1SZK8e/fuf//7X+3r169//vnnhw8f/v333xQAgKfu48ePHz58+OOPP2rv3r37+++/H3s8AAD8UB8+fKglSfLx48fHHgkAAD/Up0+faldXV489DAAAHoEgCABQUYIgAEBFCYIAABUlCAIAVJQgCABQUYIgAEBFCYIAABUlCAIAVJQgCABQUYIgAEBFCYIAABUlCAIAVJQgCABQUYIgAEBFCYIAABUlCAIAVNQcQfDufOuouXez0OH8hJbqNFvPN3bbjz0IAGBJzFMRTPaWJyFl3R68Kj/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6oGYAAJbIPFPD0Ve3AQCwHOa6RzBp7CgKAgAsqfkWi1wfbq7vtxY3GgAAfpg5Vw2bHQYAWFaCIABARS16ari9v7K+sdued1gAADy0RS8WuT7cXPdYGQCAJbDwx8e83lURBABYBot8oHTS2FlZ39hsvF3EwAAAeFizBsH2vvlfAIClNueqYQAAlpUgCABQUYIgAEBFCYIAABUlCAIAVJQgCABQUYIgAEBFCYIAABUlCAIAVJQgCABQUYIgAEBFCYIAABUlCAIAVJQgCABQUYIgAEBF1ZIk+fjx42MPAwCAH+rTp0//B5ViAzzrIfLuAAAAAElFTkSuQmCC" alt="" />

使用Yii表单生成页面的时候,如果表单的提交方式为POST,是都会在页面中添加一个隐藏字段,这个隐藏字段就是CSRF令牌验证字段
用户在提交表单的同时,将该字段提交给服务器端,Yii框架会将该有客户端提交过来的隐藏字段和客户端提交过来的Cookie中的YII_CSRF_TOKEN值进行比较。
相同则通过继续执行,不相同则会抛出400异常:"The CSRF token could not be verified."。
所以就出现了上面的问题,如果是自己写的表单,可以在视图页面的表单添加隐藏的令牌验证字段
方法二、在表单中增加隐藏的验证字段

 <input name="_csrf" type="hidden" id="_csrf" value="<?= Yii::$app->request->csrfToken ?>">

第三种解决办法是在AJAX中加入_csrf字段:

 var csrfToken = $('meta[name="csrf-token"]').attr("content");
$.ajax({
type: 'POST',
url: url,
data: {_csrf:csrfToken},
success: success,
dataType: dataType
});

注:本文由王智磊(王大宝儿)整理编写,也参考借鉴了很多大神的笔记,分享代码,分享成功,欢迎各位交流和转载,转载请注明出处(博客园:王大宝儿)http://www.cnblogs.com/wangzhilei/

 

yii2.0中解决post的400错误的更多相关文章

  1. yii2.0中url重写实现方法

    在yii框架里有前台和后台页面,举例前台url重写. 控制器与路由 控制器以Controller作为后缀,继承自yii\web\Controller; 动作以action作为前缀,public访问修饰 ...

  2. yii2.0 中的队列

    a yii2 extension to make simple to use queue. yii2-queue让队列的使用在yii2中变得更轻松,她为各种队列组件的使用提供了一个标准的接口,您只需要 ...

  3. YII2.0中实现高级注册

    如何在不修改逻辑代码的情况下完美解决以上三个问题?看了下面的教程,一目了然! 以高级版2.0.6为例,打开/frontend/models/SignupForm.php class SignupFor ...

  4. 在Yii2.0中实现计划任务(cron)

    以下由我们在信易网络公司开发项目的时候终结出的一些经验 Create console application 创建命令行应用 In advance template there is already ...

  5. Yii2.0中场景的使用小记

    熟悉Yii框架的人都知道,灵活的使用场景可以达到事半功倍的效果! 比如普通的数据的新增.修改,新增需要验证其中两个字段,而修改只需要验证其中一个字段:还有种情况,也是我们现在用到的,同一张表(同一个m ...

  6. yii2.0中Rbac 怎么添加超加管理员

    最笨的是定义常量.具体怎么做?看下面: //定义在控制器声明上面define('BEST_PHPER',serialize(array('admin','admin1')));//设置admin管理员 ...

  7. yii2.0中数据缓存之增删改查

    public function actionSss(){ /* * 获取到缓存 * 这里是获取的是根目录下 的common/main.php中的缓存类组件 * */ $cache=\Yii::$app ...

  8. Yii2 Post请求的时候出现400错误

    Bad Request (#400) Unable to verify your data submission.   http://www.yiiframework.com/forum/index. ...

  9. 在yii2.0中封装一个生成验证码的控制器

    frontend目录下/封装的验证码类: <?php namespace frontend\controllers; use yii\base\Controller; class CapathC ...

随机推荐

  1. 深入理解子元素的width与父元素的width关系

    深入理解父元素与子元素的width关系 对于这一部分内容,如果理解准确,可以更容易控制布局,节省不必要的代码,这里将简单研究. 第一部分:父子元素都是内联元素 代码演示如下: <!DOCTYPE ...

  2. springboot+redis实现缓存数据

    在当前互联网环境下,缓存随处可见,利用缓存可以很好的提升系统性能,特别是对于查询操作,可以有效的减少数据库压力,Redis 是一个开源(BSD许可)的,内存中的数据结构存储系统,它可以用作数据库.缓存 ...

  3. Netty构建Http服务器

    Netty 是一个基于 JAVA NIO 类库的异步通信框架,它的架构特点是:异步非阻塞.基于事件驱动.高性能.高可靠性和高可定制性.换句话说,Netty是一个NIO框架,使用它可以简单快速地开发网络 ...

  4. 1 复习ha相关 + weekend110的hive的元数据库mysql方式安装配置(完全正确配法)(CentOS版本)(包含卸载系统自带的MySQL)

    本博文的主要内容是: .复习HA相关 .MySQL数据库 .先在MySQL数据库中建立hive数据库 .hive的配置 以下是Apache Hadoop HA的总结.分为hdfs HA和yarn HA ...

  5. ZOJ 2856 Happy Life

    Problem Description Do you know Utopia? It's a perfect world in which everyone leads a happy life. A ...

  6. 【百度之星2014~复赛 解题报告~正解】The Query on the Tree

    声明 笔者最近意外的发现 笔者的个人网站http://tiankonguse.com/ 的很多文章被其它网站转载,但是转载时未声明文章来源或参考自 http://tiankonguse.com/ 网站 ...

  7. php的stristr()函数,查找字符

    1.用法,要传2个参数 stristr(string,search):查找并返还匹配后,剩下的部分字符串 查找过程不区分大小写,要区分大小写用 strstr(string,search)少一个字母i ...

  8. C#控件随窗体大小改变而改变

    几种方法:1.点击控件,属性,里面有一个Dock,选择Fill,就会变得和它的父容器一样大.而且会随之变化.2.点击控件,属性,里面有一个Anchor,选择Top,Right,Bottom,Left. ...

  9. zato——Channels Outgoing connections

    Channels,服务获得请求.方式 AMQP JMS WebSphere MQ plain HTTP SOAP ZeroMQ 其中,只有HTTP是同步的 Plain HTTP和SOAP暴漏服务直接通 ...

  10. 了解:C#三维数组和锯齿数值

    此文章,只需了解,用到的不多. string[,,] three = new string[2, 3, 5];  //定义一个三维数组,给数组分别辅助2,3,5 对此数组的解释://有2个二维数组,每 ...