Qualcuno potrebbe gentilmente farmi capire cosa c'è che non va con questo codice?
Codice PHP:
if(strlen($_POST['titolo']) > 0 && strlen($_POST['descr']) > 0){
if(($_FILES['file_name']['error'] == UPLOAD_ERR_OK) && ($_FILES['file_name']['size'] <= $_POST['max_file_size'])) {
if (is_uploaded_file($_FILES['file_name']['tmp_name'])) {
$search = array(',','\'',' ','=','$','"','!');
$percorso_destinazione = "/documents/school/polls/".strtolower(str_replace($search,"_", $_FILES['file_name']['name']));
if (file_exists($percorso_destinazione)) {
header("Location: /specialareas/reserved/".$_SESSION['mypage'].".php?error=fileexist");
break;
}
move_uploaded_file($_FILES['file_name']['tmp_name'], $percorso_destinazione);
header("Location: /specialareas/reserved/".$_SESSION['mypage'].".php?error=noerror");
} else {
header("Location: /specialareas/reserved/".$_SESSION['mypage'].".php?error=notfile");
}
} else {
header("Location: /specialareas/reserved/".$_SESSION['mypage'].".php?error=notfile");
}
} else {
header("Location: /specialareas/reserved/".$_SESSION['mypage'].".php?error=nosend");
}
Ringrazio in anticipo chi risponde..