I am not sure that it is the best way to do it but here is my solution:
I redirect the page with:
header("Location: page1.php);
to page1.php which contains a message about the process in progress then
after a few moments redirecting to page2.php with javascript:
<script>
setTimeout("redirect()", 500)
function redirect()
{
window.location = "page2.php"
}
</script>
In this case it redirects in 500msecs, ie half second. Then page2.php done
the real job which is MySql query but does not display results or send
anything to browser untill query completed. In that case the previous output
stays on screen until the query completed.
I know that it is not a efficient method but a solution. If anyone knows how
to refresh a browser at anytime I will glad to know. And if someone knows if
there is a way to refresh only one part of browser (I mean just inside a
layer or so..) I really want to know. In that case one can show results as
they come from database. It is really good if you have a huge database and
searching on multiple tables and/or databases.
yours,
--
Tolga 'thorr' Orhon
"Phil Glatz" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> I have a page that displays a few lines, then runs a database query that
> takes five or six seconds. I'd like to flush stdout and display the first
> text while the query is running, so the user doesn't think the site is
> down. What's the best way to accomplish this? thanks
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> To contact the list administrators, e-mail: [EMAIL PROTECTED]
>
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]