everisk Posted February 4, 2009 Share Posted February 4, 2009 Hi, I have a script where values are passed to another processing script via AJAX. The processing script may takes a few minutes to finish therefore I'd like to return a response to user before process finishes. I have done this is flash form but now with AJAX my code doesn't seem to work. My code is below. Thanks! $response = "Processing is finished"; ob_end_clean(); ob_start(); header("Connection: close"); echo $response; $size = ob_get_length(); header("Content-Length: $size"); ob_end_flush(); flush(); /// long process goes after this /// Link to comment https://forums.phpfreaks.com/topic/143760-return-response-to-ajax-before-script-ends/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.