0

isset($_POST) doesn't work with PHP7 for me, i have the exact same script running on a different server with PHP5 and it works fine.

HTML:

<form name="addItem" method="POST" action="" enctype="multipart/form-data">
     <input name="ficheiroMP3" type="file" size="30" accept="audio/mp3" id="ficheiroMP3" />
     <input name="submitUpload" id="submitUpload" type="submit" value="Upload" />
</form>

PHP:

if (isset($_POST['submitUpload'])) {
    $uploadFileMP3 = "../_mp3/" . "guilt_" . time() . ".mp3";
    if (move_uploaded_file($_FILES['ficheiroMP3']['tmp_name'], $uploadFileMP3)) {
        echo "SUCCESS";
    } else echo "ERROR";
} else var_dump($_POST);

the upload code is never executed, i get array(0) { } from var_dump($_POST);

Filipe Sá
  • 372
  • 1
  • 5
  • 15

0 Answers0