title: On form submit background function php running
body: <p>I am looking for a way to start a function on form submit that would not leave the browser window waiting for the result.</p>
  
  <p>Example:
  User fills in the form and press submit, the data from the form via javascript goes to the database and a function in php that will take several seconds will start but I dont want the user to be left waiting for the end of that function. I would like to be able to take him to another page and leave the function doing its thing server side.</p>
  
  <p>Any thoughts?</p>
  
  <p>Thanks</p>
  
  <hr>
  
  <p>Thanks for all the replies...</p>
  
  <p>I got the ajax part. But I cannot call ajax and have the browser move to another page.</p>
  
  <p>This is what I wanted.</p>
  
  <p>-User fills form and submits
  -Result from the form passed to database
  -long annoying process function starts 
  -user carries on visiting the rest of the site, independent of the status on the "long annoying process function"</p>
  
  <p>By the way and before someone suggests it. No, it cannot be done by cron job</p>