php的smarty模板中控制器中的关于上传代码哪里有错?
privatefunctionshangchuan(){if(isset($_POST['send'])){Tools::dump($_POST);if(is_uploa...
private function shangchuan(){
if(isset($_POST['send'])){
Tools::dump($_POST);
if(is_uploaded_file($_FILES['tupian']['tmp_name'])){
$this->model->id=$_POST['id'];
$upload=new UploadFile("tupian","public/uploads/logo/");
if($upload->upload("tupian")){
$logo=$upload->getNewName();
if($this->model->addlogo()){
Tools::Redirect("添加公司logo成功","?b=logo",1,1);
}else{
Tools::Redirect("添加公司logo失败","?b=logo",2,1);
}
}else{
Tools::getBack($upload->getErrorMsg());
}
}else{
$logo="default.jpg";
}
}
} 展开
if(isset($_POST['send'])){
Tools::dump($_POST);
if(is_uploaded_file($_FILES['tupian']['tmp_name'])){
$this->model->id=$_POST['id'];
$upload=new UploadFile("tupian","public/uploads/logo/");
if($upload->upload("tupian")){
$logo=$upload->getNewName();
if($this->model->addlogo()){
Tools::Redirect("添加公司logo成功","?b=logo",1,1);
}else{
Tools::Redirect("添加公司logo失败","?b=logo",2,1);
}
}else{
Tools::getBack($upload->getErrorMsg());
}
}else{
$logo="default.jpg";
}
}
} 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询