This is my 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>
And this is my 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(****));
}
}
}
The problem that i have is that the $add variable is empty....why?
P.S: Everything else seems to work fine.