您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

ThinkPHP小白 POST无效,该如何解决

2024/5/1 12:20:24发布15次查看
thinkphp小白 post无效
本帖最后由 bluicezhen 于 2013-03-18 22:38:39 编辑 根据post的值来显示页面,但似乎获取不到post的值:
$username = $this->$_post['username'];
//$name = $this->_post('name'); 换成这行业无效。
$user = m('user');
$data = $user->where('username='.$username.'')->field('id,username')->find();
if($data) {
$this->success('成功');
}else{
$this->error('失败');
}

但是用_param方法就成功了。请高手解释一下。 thinkphp?post php
------解决方案--------------------
你的post参数不是username吗?
$this->_post('name');当然无效,$this->_post('username');试下
------解决方案--------------------
楼主dump($_post);试一下爱
该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product