on Win2K/Apache 1.3/ PHP 4.3.1

I have a script which performs several ODBC queries which take up to 5 minutes each. I want to do somethign like

<html>
<body>
Please Wait<br>
<?
----Query HERE----
echo "Part 1 Complete<be>\n";
flush();

----Query 2 HERE----
echo "Part 2 Complete<be>\n";
flush();

?>

etc etc....

I have tried flush();
tried flush():flush();flush();
tried flush();ob_flush();
tried adding 255 chars of blank space...

But on Netscape and on IE it appears as if the server is not sending anything until the php script has completed (not flushing to the browser)......

Has anyone gotten this to work on windows?

    I have....
    Do you have output buffering enabled in php.ini?

    The manual also says that Windows may buffer it anyway. I had no problems on Win2K Server. Haven't tried it on one of the non-server products.

      I wonder if the browser is receiving it, but not rendering it.

      Try wrapping it in a <div>...</div> or something. The </div> hopefully will tell the browser that that element is complete and it can attempt to render it.

      Using plain text (with the appropriate Content-Type header) might also avoid delays in the renderer, if that is the problem.

        swr is on the right track. Windows browsers tend to buffer page content until the outermost container is completed. So, for instance, if you are putting the entire page into a table for formatting, nothing is displayed until the browser gets the last < /table> tag.

        Even if you are not doing such a thing and sending just the raw text, some browser versions will still buffer the data since they will assume a < html> and < /html> container.

        If you want to make sure the browser displays the info as you send it, put it inside a container such as:

        print "<P>Message One...</P>\n";
        flush;
        print "<P>Message Two...</P>\n";
        flush;
        

        That should do the trick for you.

          This may sound stupid...But I think the problem is Apache 1.3 on windows. I have another box with apache 2.0 on windows and this works just fine...

          Has anyone actually gotten this to work on apache 1.3 on windwos?

            It doesn't sound stupid, but I would think that it more likely a configuration difference rather than an issue with the version. One may be configured slightly differently than the other. I have servers running 1.4 and 2.0 (Windoze & Linux) and they seem to behave the same way with regard to this issue.

              Write a Reply...