title: PHP can't upload file from HTML form
body: <p>This is how I handle my form:</p>
  
  <pre><code>        # Create the message
          # ----------------------------------------------------------------
          $name = $_POST['name'];
          $email = $_POST['email'];
          $title = $_POST['title'];
          $course = $_POST['course'];
          $file = $_POST['file'];
  
          $message  = "Name: ".$name."\n";
          $message .= "Email: ".$email."\n\n";
          $message .= "Title of Article: ".$title."\n";
          $message .= "Program: ".$course."\n\n";
          $message .= "Additional Info: ".$info;
  
          # Upload temporary files
          # ----------------------------------------------------------------
          $uploaddir = '/home/public/uploads/';
          $uploadfile = $uploaddir . basename($_FILES['file']['name']);
          if (move_uploaded_file($_FILES['file']['tmp_name'], $uploadfile) == false) {
              echo 'Could not move file';
              exit;
          }
  
          if ($_FILES['file']['type'] != "application/pdf") {
              echo 'Not a pdf file';
              unlink($uploadfile);
              exit;
          }
  </code></pre>
  
  <p>The end product is hopefully sending an email with the file as an attachment. Right now I'm failing and getting the "Could not move file" message I built in. Is there an obvious reason why? <code>$file</code> is what I get from a file dialog in HTML (<code>input type="file"</code>)</p>