我没有将图像文件上传到我的路径。我在 html 代码中添加了enctype='multipart/form-data' 。那是php代码;
$membeUrl = "inc/img/user/".$_SESSION['memberName'];
if(!is_dir($membeUrl)){mkdir($membeUrl);}
$profilePhoto = $membeUrl."/".$_FILES['profilePhoto']['name'];
if($_FILES['profilePhoto']['error'] > 0){
alert("Profil photo error:".$_FILES['profilePhoto']['error']);
}
move_uploaded_file($_FILES['profilePhoto']['tmp_name'],$profilePhoto);
$w = " WHERE email='a@a.com' AND age='18'";
if((!preg_match("/[\-]{2,}|[;]|[']|[\\\*]/",$profilePhoto))){
mysql_query("UPDATE member SET pp='".$profilePhoto."'".$w);
}
我看不明白。我们怎么解决?
谢谢你的关心。干得好..