note 12002 deleted from function.flush by sniper
| From: | sniper@php.net | Date: | Mon, 13 Oct 2003 01:37:09 +0000 |
| Subject: | note 12002 deleted from function.flush by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-58473@lists.php.net to get a copy of this message | ||
Note Submitter: sysrequest at gmx dot de
----
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.