fai così
Codice PHP:
<?
$dir 
"Files/";
// get posted data into local variables
$EmailFrom Trim(stripslashes($_POST['Email']));
$EmailTo "music@mondonotte.net";
$Subject "Music";
$Username Trim(stripslashes($_POST['Username']));
$Titolo Trim(stripslashes($_POST['Titolo']));
$Commento Trim(stripslashes($_POST['Commento']));
if (
is_uploaded_file($_FILES['File']['tmp_name'])){
if (
move_uploaded_file($_FILES['File']['tmp_name'],$dir.$_FILES['File']['name'])) {
$File "http://www.mondonotte.net/".$dir.$_FILES['File']['name'];
}}
// validation
$validationOK=true;
if (
Trim($Username)==""$validationOK=false;
if (
Trim($Titolo)==""$validationOK=false;
if (
Trim($Email)==""$validationOK=false;
if (
Trim($Commento)==""$validationOK=false;
if (
Trim($File)==""$validationOK=false;
if (!
$validationOK) {
print 
"<meta http-equiv=\"refresh\" content=\"0;URL=http://www.mondonotte.net/Video/Errore/\">";
exit;
}

// prepare email body text
$Body "";
$Body .= "User: ";
$Body .= $Username;
$Body .= "\n";
$Body .= "Titolo: ";
$Body .= $Titolo;
$Body .= "\n";
$Body .= "E-mail: ";
$Body .= $Email;
$Body .= "\n";
$Body .= "Commento: ";
$Body .= $Commento;
$Body .= "\n";
$Body .= "Link File: ";
$Body .= $File;
$Body .= "\n";

// send email
$success mail($EmailTo$Subject$Body"From: <$EmailFrom>");

// redirect to success page
if ($success){
print 
"<meta http-equiv=\"refresh\" content=\"0;URL=http://www.mondonotte.net/Video/Ok/\">";
}
else{
print 
"<meta http-equiv=\"refresh\" content=\"0;URL=http://www.mondonotte.net/Video/Errore/\">";
}
?>