开发者

Form with file input field wierdness

开发者 https://www.devze.com 2023-01-08 06:23 出处:网络
Ok. I\'m probably just to tired to spot an issue here. The problem is when I submit this form, the attached file does not get submitted. $_FILES array in PHP is always empty.

Ok. I'm probably just to tired to spot an issue here. The problem is when I submit this form, the attached file does not get submitted. $_FILES array in PHP is always empty.

Here is HTML form:

<form enctype="multipart/form-data" method="post" action="navigator.php?kam=editovatElearningKurz&id=-13">
  <dl>
   <dt>
    <label for="documentName">Názov dokumentu</label>
   </dt>
   <dd>
    <input type="text" name="documentName" id="documentName" value="" />
   </dd>
   <dt>
    <label for="document">Dokument, ktorý chcete pridať ku kurzu</label>
   </dt>
   <dd>
    <input type="hidden" name="MAX_FILE_SIZE" value="10000000" />
    <input type="file" name="document" id="document" />
   </dd>
   <dt>
    &nbsp;
   </dt>
   <dd>
    <input type="submit" name="pridatDokument" id="pridatDokument" value="Pridať dokument" />
   </dd>
  </dl>
 </form>

In PHP I do:

if (isset($_POST['pridatDokument'])) {
    var_dump($_FILES);
}

The array is always empty. I've been trying to spot the mistake for some time now but it s开发者_如何学编程eems my blurry eyes can't do it at this evening hour.


You have ecntyp instead of enctype

0

精彩评论

暂无评论...
验证码 换一张
取 消