flushing AJAX scripts
| From: | jim white | Date: | Thu, 26 Mar 2009 20:01:45 +0000 |
| Subject: | flushing AJAX scripts | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-290712@lists.php.net to get a copy of this message | ||
I am using jQuery AJAX request to run a script that can take several minutes to create a report. I want to start the script and immediately echo a response to close the connection and then let the script complete a report which I can get later. I have tried several thing such as
ob_start();
echo json_encode(array("time"=>$now, "message"=>"Report has started running!"));
ob_end_flush();
However, the script does not respond and (I suppose close the connection) until the report is complete. How can I fix this behaviour?
Jim
--
James (Jim) B. White
tel: (919)-380-9615
homepage: http://jimserver.net/