On 3/Apr/2005 05:39 Tan Rezaei wrote ..
>
> Hi all,
> I am sure this question has been asked many times but I can't seem to find
> the answer anywhere.
> I am trying to write the output of my cgi as it happens. I have a loop
> that
> runs a certain UNIX command about 1000 times and each time prints the
> output. Well It doesn't actually show me any of the output until its done
> so
> the users have to wait and wait .. Sometimes the refresh the screen and
> we
> all know what that will do.
> How does webmin handle this ? I am trying to duplicate the feel of the
> module download page or the fsdump module but can't seem to figure out
> what
> that code is really doing.
The best way to force output to be sent immediately to the browser is for
your CGI to call the ui_print_unbuffered_header function instead of ui_print_header.
Or if you are not using those ui-lib.pl functions, you can use code like :
$| = 1;
$theme_no_table = 1;
&header("page header", "");
- Jamie
|