title: Upload image using jquery
body: <p>I have a working php code to upload image in the database. Is it Possible to transform it to jquery? If so, what do I need to do? I am new to jquery btw. Thanks</p>
  
  <p>This code works just fine. But I need to do it in jquery.</p>
  
  <pre><code>&lt;form action = 'upload.php' method = 'post' enctype="multipart/form-data"&gt;
  
      &lt;input type="file" name="image" &gt; &lt;br&gt;
      &lt;input type= 'submit' value = 'Add' id = 'Add' name = 'Add'&gt;
  
  &lt;/form&gt; 
  
  
  &lt;?php   
      if(isset($_FILES['image']))
      {
      $target_Path = "images/";
      $target_Path = $target_Path.basename($_FILES['image']['name'] );
      move_uploaded_file( $_FILES['image']['tmp_name'], $target_Path );
  
      $name = $_FILES['image']['name'];
      }
      if(isset($_POST['Add']))
      {
  
          if($_POST["Add"] == "Add") 
          {
          $add = "Insert Into img(path) Values('$name')";
          $up = mysql_query($add);
  
              $status = "Upload success!";
              print '&lt;script type="text/javascript"&gt;'; 
              print 'alert(" '.$status.' ")'; 
              print '&lt;/script&gt;';                  
          }
      }
  </code></pre>