Forum Moderators: coopster

Message Too Old, No Replies

Print out before loading another webpage

         

fib_81

10:23 pm on Mar 6, 2006 (gmt 0)

10+ Year Member



Is there a way to printout some string before loading a new page. I use sleep after I print something out and then used a header to direct the browser to another page.
For example:

echo "Foo";
sleep(10);
header("Location: ./foo.php");

So far, php did not print out anything and the browser goes directly to foo.php

coopster

12:07 am on Mar 7, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



You can't send any output to the browser before a header() [php.net] function. More reading on the manual page link.

jatar_k

1:24 am on Mar 7, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



maybe output your string and then use a META refresh