help in implementing a progress bar
--0016e64b96e22ac2f2047c990725
Content-Type: text/plain; charset=ISO-8859-1
Hello,
Theres this project that I am working on, and a specific module does take
few secs to process, I am thinking it would be cool to be showing a progress
bar(some kind on a .gif image) while the script runs, does any one have an
idea how to implement this?
Thanks,
Vinay K
--0016e64b96e22ac2f2047c990725--
Re: help in implementing a progress bar
On Jan 7, 2010, at 2:36 PM, Vinay Kannan wrote:
> Hello,
>
> Theres this project that I am working on, and a specific module does =
take
> few secs to process, I am thinking it would be cool to be showing a =
progress
> bar(some kind on a .gif image) while the script runs, does any one =
have an
> idea how to implement this?
>
> Thanks,
> Vinay K
This isn't really database related, but ok...
<?php
// Progress.php
class Progress {
public function start () {
echo file_get_contents ('progress.html');
flush ();
}
public function end ($url) {
$text =3D "<script type=3D\"text/javascript\">";
$text .=3D "window.location =3D '$url';";
$text .=3D "</script>";
echo $text;
flush ();
}
}
?>
<?php
// process.php - process the stuff
$progress =3D new Progress();
$progress->start();
// ... Do your processing here ...
$progress->end('nextpage.php');
?>
In the progress.html file, it would just be an html page that has an =
animated gif (and whatever else you want on it). Hope this helps.
~Philip=
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php