$studentInfo->setGssznj($array_studentInfo['gssznj']); $studentInfo->setMemo($array_studentInfo['memo']); if ($_FILES['photo']['name'] != '') { /*-- 实例化上传类 --*/ $file = $_FILES['photo']; $upload_path = '../upload'; $allow_type = array('jpg', 'bmp', 'png', 'gif', 'jpeg'); $max_size = 2048000; $upload = new upFiles($file, $upload_path, $max_size, $allow_type); $upload->upload(); $pic = $upload->getSaveFileInfo(); $photo = substr($pic['path'], 2) . "/" . $pic['savename']; $studentInfo->setPhoto($photo); } //完成修改->数据库 $res = $studentInfoService->UpdateStudentInfo($studentInfo); if ($res != 0) { header("Location: /ok.php"); exit; } else { //失败 header("Location: /error.php"); exit; } } else { if ($action == "del") { //这时我们知道要删除学生信息信息 $zkzh = $_GET['zkzh']; if ($studentInfoService->DeleteStudentInfo($zkzh) == 1) { //成功 header("Location: /ok.php");