非法数据对象!:[isallow=>0]

浏览:1078 发布日期:2015/04/27 分类:求助交流
// 用户信息修改
public function update(){

if(!empty($_FILES)){
//图片上传设置
$config = array(
'maxSize' => 3145728,
'rootPath' => 'Public',
'savePath' => '/static/uploads/',
'saveName' => array('uniqid',''),
'exts' => array('jpg', 'gif', 'png', 'jpeg'),
'autoSub' => false,
'subName' => array('date','Ymd'),
);
$upload = new \Think\Upload($config);// 实例化上传类
$images = $upload->uploadOne($_FILES['headpic']);
//判断是否有图
if($images){
// $images['savename']就是图片的名字
$_POST['headpic'] = $images['savename'];
}
else{
$this->error($upload->getError());//获取失败信息
}
}
$users = M('users');
$res = $users -> where("id='{$_POST['id']}'") -> save($_POST);
if($res){
$this->success('修改成功');
}else{
$this->error('修改失败');
}

}
最佳答案
评论() 相关
后面还有条评论,点击查看>>