19-如何增强表单验证
用来解决表单恶意留言的问题
\app\index\controller\Myform.php 文件中,插入以下代码
` if ($param['__token__'] != session('__token__')) {
$info = ['status'=>'error','msg'=>'令牌验证验证失败!'];
return $this->onresponse($info, $returntype); exit();
}`
![78913c4009e0ca63e5d521c410dc9706_.png](https://cos.easydoc.net/55430207/files/lchb8m9t.png)