parent.success()"); exit(0); } $boundary = "cutHere"; function sendHeader() { global $boundary; echo("--$boundary\r\n"); echo("Content-Type: text/html\r\n\r\n"); flush(); } header("Content-Type: multipart/x-mixed-replace; boundary=$boundary"); // generate some padding to work around CFNetwork handling of multipart data $padding = "aa"; for ($i = 0; $i < 10; $i++) { $padding .= $padding; } sendHeader(); ob_end_flush(); echo("test html\n"); echo(""); flush(); sendHeader(); echo("second html"); echo(""); echo(""); flush(); sendHeader(); echo("third html"); echo(""); flush(); usleep(20 * 1000000); ?>