title: PHP: File is Not Uploading
body: <p>I have the following code but file is not uploading in the directory:</p>
  
  <pre><code>&lt;?php
      include "includes/dbconn.php";
      $tbl_name="finfo"; // Table name 
      $fname=$_POST['T1'];
      $fn=$_FILES['file']['name'];
  
      if ($_FILES["file"]["error"] &gt; 0) {
          echo "Return Code: " . $_FILES["file"]["error"] . "&lt;br&gt;";
      } else {
          $source = $_FILES['file']['tmp_name'];
          $target = "uploads/".$fn;
          move_uploaded_file($source, $target);
          echo $source. "&lt;br&gt;";
          echo $target. "&lt;br&gt;";
          echo $fn. "&lt;br&gt;";
      }
  
      $furl= "uploads/" . $_FILES["file"]["name"];
      $fsize= (round ($_FILES["file"]["size"] / 1024)) . " kB";
      $nod=0;
      $sqlinsert="insert into " . $tbl_name ." (fname,furl,fsize,nod) values     ('".$fname."','".$furl."','".$fsize."',".$nod.")";
      $rsadd = mysql_query($sqlinsert);
      if(!$rsadd) {
          echo "Ehh, Something going wrong!!!!";
      } else {
          echo "One Record Inserted Successfully!!!";
      }
  ?&gt;
  </code></pre>
  
  <p>Please dont bother with the SQL, I have no problem with that.. but the file is not uploading in the directory. The directory is in the same parent folder where this php files belongs.</p>