I've got a problem with an empty $_POST array while i'm uploading a file.
Here's the form :
<div class="popup">
<h3>UPLOAD</h3>
<a class="close" href="#">×</a>
<div class="content">
<form
id="uploadForm"
method="post"
enctype="multipart/form-data"
action="resources/upload.php?dir=<?php if(isset($_GET['dir'])){echo $_GET['dir'];} ?>"
enctype="multipart/form-data">
<input type="file" name="fichier" id="file" class="inputfile"/>
<label for="file">Choisir un fichier</label><br>
</form>
<button onClick="submitUpload();" id="smbtBtt">Uploader</button>
</div>
</div>
This is the submitUpload fonction :
function submitUpload()
{
if(document.getElementById("file").value != ""){
document.getElementById("uploadForm").submit();
}
else
{
alert("Please select a file!");
}
}
Then in the upload.php file, i just var_dump() the array $_FILES and $_POST
It's 6AM in the morning, my 5h straight of programming, so that's why i'm asking :).
Thanks a lot !
$_FILESrather than $_POST