| OLD | NEW |
| (Empty) |
| 1 <?php | |
| 2 if (isset($_GET['done'])) { | |
| 3 header("Content-Type: text/html"); | |
| 4 echo("<script>parent.success()</script>"); | |
| 5 exit(0); | |
| 6 } | |
| 7 | |
| 8 $boundary = "cutHere"; | |
| 9 | |
| 10 function sendHeader() | |
| 11 { | |
| 12 global $boundary; | |
| 13 | |
| 14 echo("--$boundary\r\n"); | |
| 15 echo("Content-Type: text/html\r\n\r\n"); | |
| 16 flush(); | |
| 17 } | |
| 18 | |
| 19 header("Content-Type: multipart/x-mixed-replace; boundary=$boundary"); | |
| 20 | |
| 21 // generate some padding to work around CFNetwork handling of multipart data | |
| 22 $padding = "aa"; | |
| 23 for ($i = 0; $i < 10; $i++) { | |
| 24 $padding .= $padding; | |
| 25 } | |
| 26 | |
| 27 sendHeader(); | |
| 28 ob_end_flush(); | |
| 29 echo("test html\n"); | |
| 30 echo("<!-- $padding -->"); | |
| 31 flush(); | |
| 32 sendHeader(); | |
| 33 echo("second html"); | |
| 34 echo("<script>parent.childLoaded()</script>"); | |
| 35 echo("<!-- $padding -->"); | |
| 36 flush(); | |
| 37 sendHeader(); | |
| 38 echo("third html"); | |
| 39 echo("<!-- $padding -->"); | |
| 40 flush(); | |
| 41 usleep(20 * 1000000); | |
| 42 ?> | |
| OLD | NEW |