Ciao a tutti vi posto prima il code poi vi spiego il problema:

Codice PHP:
<?phpif($_SERVER["REQUEST_METHOD"] == "POST" && !empty($_FILES["myfile"])){
    
define("UPLOAD_DIR"$_SERVER["DOCUMENT_ROOT"]."uploads/");
    
$file $_FILES["myfile"];
    if(
$file["error"] !== UPLOAD_ERR_OK){        echo "<p>Si è verificato un errore</p>";        exit;    }
    
$name_file preg_replace("/[A-Z0-9._-]/i""_"$file["name"]);
    
$i 0;
    
$parts pathinfo($name_file);
    while(
file_exists(UPLOAD_DIR $name_file)){        $i++;        $name_file $parts["filename"] . " ($i)" $parts["extension"];    }
    
$success move_uploaded_file($file["tmp_name"], UPLOAD_DIR $name_file);
    if(!
$success){        echo "<p>Il file inviato non è stato caricato per un errore.</p>";        exit;    }
    
chmod(UPLOAD_DIR $name_file0644);}?>
HTML:
codice HTML:
<body>
<form action="<?php echo $_SERVER["PHP_SELF"]; ?>" method="POST" id="myForm" enctype="multipart/form-data" target="hidden_frame">        <input type="hidden" value="myForm" name="<?php echo ini_get("session.upload_progress.name"); ?>">        <input type="file" name="myfile">        <input type="submit" value="Invia file">    </form>
<iframe id="hidden_frame" name="hidden_frame" src="about:blank"></iframe>
Come vedete invio il modulo alla stessa pagina "$_SEVER['PHP_SELF']" ma non invia nulla come mai?