这是我的html:
<form name = "picture" action = "upload.php" method="post" enctype="multipart/form-data">
<input type="file" name="poza" id = "profilh" onmouseover="profilehov()" onmouseout="profileleave()" onchange="javascript:document.forms['picture'].submit();"></form>
这是我的 php:
$profile = $_POST['poza'];
if($profile){
$add = $profile['poza']['name'];
$userem = $info['email'];
$allowedExts = array("gif", "jpeg", "jpg", "png");
$check = explode(".",$add);
$extension = end($check);
if((($_FILES['poza']['type']=="image/gif")||($_FILES['poza']['type']=="image/jpeg")||($_FILES['poza']['type']=="image/jpg")||($_FILES['poza']['type']=="image/png") &&($_FILES['poza']['size']<51000))&& in_array($extension,$allowedExts)){
if(file_exists("uploads/".ENCRYPTION($userem)."/".$add)){
$errors+=1;
}
if($errors == 0){
move_uploaded_file($_FILES['poza']['tmp_name'],"uploads/".ENCRYPTION($userem)."/".$add);
$sql1 = "UPDATE **** SET ****= **** WHERE **** = ****";
$res1 = mysqli_query(****,$sql1) or die (mysqli_error(****));
}
}
}
我遇到的问题是 $add 变量是空的....为什么?
PS:其他一切似乎都很好。