Is bandwidth an issue?
If not, you could have a <div> at the top of your page, flush it before
beginning your data parsing, and update it with a table with two columns, 1
with a bgcolor of some color, the other with no bgcolor, and have the width
of the columns change as the javascript updates it.


i.e.
<div id="statusDiv">&nbsp;</div>
<?
    flush();
    $last_percent = -1 /** This forces an update on the first run of the
loop **/
    while ($parsing)
    {
        $percent = $some / $calculation;
        $percent = number_format($percent,2); /** 2 dec places, ie count by
1% increments, use 3 for 0.1% inc) **/
        if ($percent != $last_percent)
        {
            $last_percent = $percent;
            $leftwidth = 300*$percent;
            $rightwidth = 300 - $leftwidth;
            $table_output = "
<table width=300 cellspacing=0 cellpadding=0 border=0
style=\"table-layout:fixed\">
<tr>
<td width=$leftwidth bgcolor=0000FF>&nbsp;</td>
<td width=$rightwidth>&nbsp;</td>
</tr>
</table>";
            echo("
<script>statusDiv.innerHTML =
'".addslashes(str_replace("\n","",$table_output))."';</script>");
            flush();
        }
    }
?>

Replace constants as required, add a formatted output of the percent
complete or any other text you want, but basically that will do it.
Bear in mind it will use quite a lot of bandwidth, so keep an eye on your
significant digits after you calc the percent.

Matt


* * * * * * * * * *
This message contains information from Techcom Software Solutions Inc. which
is confidential and privileged.  If you are not an intended recipient,
please refrain from any disclosure, copying, distribution or use of this
information and note that such actions are prohibited.  If you have received
this transmission in error, please notify [EMAIL PROTECTED]  This
message and any attachments have been scanned for viruses.

----- Original Message -----
From: Edward Peloke <[EMAIL PROTECTED]>
To: PHP General <[EMAIL PROTECTED]>
Sent: Monday, January 06, 2003 11:33 AM
Subject: [PHP] progress page


> I am working on an application that will take data from the user and run
> then check through all the data to find matches.  Instead of the user
seeing
> a blank screen while the page is loading, I would like to pop up a page
that
> says, processing, please wait and maybe have an icon like a progress bar
or
> something.  How do I pop up a page and have it disappear when the the
other
> page is done loading?
>
> Thanks,
> Eddie
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to