note 12002 added to function.flush.php
| From: | sysrequest at php2 dot chek dot com | Date: | Sat, 17 Mar 2001 16:58:37 +0000 |
| Subject: | note 12002 added to function.flush.php | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-12506@lists.php.net to get a copy of this message | ||
i wrote a few classes that (take a long time to) process an mp3 header (to store it in a db)..
anyway, i want to show the progress with dots or percentages or something like
[...10%...20%...etc]
but i want it removed after the processing is done and simply show the statistics on the page, that
is... without reloading the page.
i use a little css trick and flush() to get the job done nicely in IE, haven't tested it on
netscape yet.
the part that you want to show during the 'processing' has to be embedded in a SPAN tag
like so:
echo "<span id=\"processing\">analysing MP3...</span>";
flush();
flush() makes sure that this part gets sent to the browser already otherwise it may show up too late
then the long calculations will follow, after a few seconds you then simply send:
echo "<script>processing.style.display='none'</script>";
taadaa, and the part within the SPAN tags will disappear.
http://www.php.net/manual/en/function.flush.php