I'm attempting to do an AJAX call that will initiate a fairly long process. I'd like PHP to simply send a response indicating that the process has started, but the JavaScript code won't return the response until PHP is done running.
I've tried this with a "close" header (below), and also with output buffering; neither seems to work. Any guesses? or is this something I need to do on the client side?
<?php
echo("We'll email you as soon as this is done.");
header("Connection: Close");
// do some stuff that will take a while
mail( 'dude@example.com', "okay I'm done", 'Yup, all done.' );