title: Post multipart/ form data (both image and text ) html - Php - SQl - AJAX
body: <p>I made changes to my code </p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
  &lt;form action="test.php" id="subscriber_form" method="post" enctype="multipart/form-data"&gt;
      &lt;input type="text" id="title" name="title" &gt;&lt;br&gt;
      &lt;input type="file" id="file" name="file" &gt;&lt;br&gt;
      &lt;input type="submit" id="submit" value="submit"&gt;
      &lt;/form&gt;
      &lt;div id="show_subscriber_msg"&gt;&lt;/div&gt;
  &lt;script src="js/jquery-1.7.1.min.js"&gt;&lt;/script&gt;               
  
  &lt;script&gt;  
  $("form#subscriber_form").submit(function(){
  $('#show_subscriber_msg').html('&lt;div class=gen&gt;Submiting..&lt;/div&gt;');
  e.preventDefault();
  var formURL = $(this).attr("action");
  var formData = new FormData($(this)[0]);
  $.ajax({
  url: formURL,
  type: 'POST',
  data: formData,
  cache: false,
  contentType: false,
  processData: false,
  async: false,
  success: function (res) {
                               if(res=='1'){
                                  $('#show_subscriber_msg').html('&lt;div class=gen&gt;Thank you&lt;/div&gt;');
                               }
  
                               if(res=='5'){
                               $('#show_subscriber_msg').html('&lt;div class=err&gt;Please enter a valid email address&lt;/div&gt;');
                               }
                          }
  });
  
  });
  
   &lt;/script&gt;
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>My sql table is getting updated and file is uploaded to the directory correctly 
  But it's still redirecting me to test.php. I just want to run my php script i.e    <code>test.php</code> in background. </p>