note 33607 deleted from function.flush by alindeman
| From: | alindeman@php.net | Date: | Tue, 01 Jul 2003 20:53:17 +0000 |
| Subject: | note 33607 deleted from function.flush by alindeman | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-51315@lists.php.net to get a copy of this message | ||
Note Submitter: u_ri_p_ui@yahoo.de
----
Thanks to Alexander Keilonat and chris_lewis! Without your
help I woudn't have managed this:
it's probably usable for a chat system where messages are
streamed directly and after 100 lines the whole browser
window is cleaned.
-----------------------------------------------------------
<html>
<head>
<title>Streaming-HTML-Test</title>
</head>
<body>
<div id="id1"></div>
<?php
echo str_pad(" ", 256);
echo "\n";
for ($a=1; $a<=5; $a++)
{
echo "<script type=\"text/javascript\">\n";
echo "document.getElementById(\"id1\").innerHTML=\"\";\n";
echo "</script>\n";
for ($i=1; $i<=10; $i++)
{
echo "<script type=\"text/javascript\">\n";
echo "document.getElementById(\"id1 --
\").innerHTML=document.getElementById(\"id1 |- One line
\").innerHTML+\"Chat-Nachricht $a.$i</ br>\";\n"; --
echo "</script>\n";
flush();
ob_flush();
sleep(1);
}
}
?>
</body>
</html>