title: file upload php $_FILES undefined index error
body: <pre><code>&lt;?php
  
  $name = $_FILES["file"]["name"];
  //$size = $_FILES['file']['size']
  //$type = $_FILES['file']['type']
  
  
  $tmp_name = $_FILES['file']['tmp_name'];
  
  $error = $_FILES['file']['error'];
  
  if (isset ($name)) {
      if (!empty($name)) {
  
      $location = 'uploads/';
  
      if  (move_uploaded_file($tmp_name, $location.$name)){
          echo 'Uploaded';    
          }
  
          } else {
            echo 'please choose a file';
            }
      }
  ?&gt;
  
  &lt;form action="upload.php" method="POST" enctype="multipart/form-data"&gt;
      &lt;input type="file" name="file"&gt;&lt;br&gt;&lt;br&gt;
      &lt;input type="submit" value="Submit"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p>i get an 'Notice: Undefined index' error message. The enctype is included in the form tag so i can't figure out what it is.. can anyone help me out??</p>