tags:

views:

28

answers:

1

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 seems my blurry eyes can't do it at this evening hour.

+3  A: 

You have ecntyp instead of enctype

Fosco
Spot on. That was the problem.
Richard Knop