...

View Full Version : Closing socket to client and continuing script execution



Onetoomanysodas
07-25-2007, 11:20 PM
I am developing some AJAX apps and I need to close the socket connection with the client so the browser will execute the server response without waiting for the script to complete it's execution.

Here's what I want:

<?php
$bar = $_POST['foo'];
echo "alert('You said '".$bar."')";

// close connection with client so browser evaluates server response

someFunctionThatTakesALongTime();
?>


Any help would be most appreciated.

Mwnciau
07-26-2007, 02:37 AM
Use flush(); to force anything echoed so far in the script to be outputted



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum