i made a form page to upload files
<form role="form" action="portfilio.php" method="post" enctype="multipart/from-data">
<textarea class="form-control textarea" name="desc"></textarea>
<input type="file" name= "img" class="custom-file-input" id="exampleInputFile">
when i want to test it if he is working or not by using this code
if (isset($_POST['desc'])) { echo '<pre>'; print_r($_FILES);die; }
should send somthing like result but not just empty array like :
Array ()but why ? where the wrong ??
(1) Please fix the typo and use
enctype="multipart/form-data"(2) Please use $_POST and $_FILES to get the submitted data details, as follows:
So , amend your code to
HTML
and
test1.php
The result (if you type something in the textarea and pick a file, then submit) will be like (well tested):