Re: output buffering problem
| From: | electroteque | Date: | Tue, 17 Dec 2002 21:30:58 +0000 |
| Subject: | Re: output buffering problem | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-92568@lists.php.net to get a copy of this message | ||
actually i singled it out , it doesnt flush until the end of the loop, so it
waits till the loop is finished and then flushes i suppose this is a bug.
"Electroteque" <daniel@electroteque.org> wrote in message
news:20021217211650.84320.qmail@pb1.pair.com...
> hi guys i have the latest cvs , my function used to work now it doesnt
>
> function
> progressbar_percentage($i,$files,$newwin,$moviename,$status,$sleep=null){
> if (is_array($files)) $per = $i/count($files); else $per = $i/$files;
> $per = $per*100;
> $buffer = "<script language=\"javascript\">\n";
> $buffer .= "var movie=".$newwin.".document.".$moviename.";\n";
> $buffer .= "movie.TGotoFrame(\"_root.Status\", 1);\n";
> $buffer .= "movie.SetVariable(\"_root.Status.processing\",
> \"".$status."\");\n";
> $buffer .= "movie.TSetProperty(\"_root.Bar\",2,
> ".ceil($per).");\n";
> $buffer .= "movie.SetVariable(\"_root.Percent.per\",
> \"".ceil($per)."
> %\");\n";
> $buffer .= "</script>\n";
> print ($buffer);
> flush();
> sleep(1);
> }
>
> this i meant to flush on every loop and show a progress percentage
although
> now php wont flush anything until half way through the loop and causes
> javascript errors as it never flushed until too late , what could be the
> problem ?
>
>