ThinkPHP 3.0 怎么提交都是令牌表单错误
thinkphp吧
全部回复
仅看楼主
level 11
chendenannan 楼主
表单令牌错误
form.html
<html>
<head>
<title>Tpl/index/表单数据测试</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<form action="__URL__/insert2" method="post">
<p>用户名:<input type="text" name="username"/></p>
<p>密 码:<input type="password" name="password"/></p>
<p>邮 箱:<input type="text" name="email"/></p>
<p><input type="submit" value="提交"/></p>
</form>
</body>
</html>
insert2
public function insert2(){
$this->charset("utf-8");
$Dao = D("User");
if($Dao->create()){
if($lastInsID = $Dao->add()){
echo "插入数据 id 为: $lastInsID";
} else {
echo "数据写入错误!";
}
}else{
exit($Dao->getError().'[ <a href="javascript:history.back()">返回</a> ]'); }
}
2012年09月12日 03点09分 1
level 1
同问啊!!
2013年05月07日 16点05分 2
1