Connecting Tech Pros Worldwide Help | Site Map

how to refresh the screen

windandwaves
Guest
 
Posts: n/a
#1: Jul 17 '05
Hi Folk

I have a PHP script like this:

<?php

echo "this may take some time";

.....lots of stuff

{reload new page with result}

?>

how do I get the page to refresh so that the user will see the message while
it is waiting for the process to continue?

TIA

- Nicolaas


R. Rajesh Jeba Anbiah
Guest
 
Posts: n/a
#2: Jul 17 '05

re: how to refresh the screen


windandwaves wrote:[color=blue]
> Hi Folk
>
> I have a PHP script like this:
>
> <?php
>
> echo "this may take some time";
>
> ....lots of stuff
>
> {reload new page with result}[/color]

<snip>
1. meta refresh
2. header refresh (non-standard, but works in many browsers)

--
<?php echo 'Just another PHP saint'; ?>
Email: rrjanbiah-at-Y!com Blog: http://rajeshanbiah.blogspot.com

f700b
Guest
 
Posts: n/a
#3: Jul 17 '05

re: how to refresh the screen




windandwaves ha escrito:[color=blue]
> Hi Folk
>
> I have a PHP script like this:
>
> <?php
>
> echo "this may take some time";
>
> ....lots of stuff
>
> {reload new page with result}
>
> ?>
>
> how do I get the page to refresh so that the user will see the message while
> it is waiting for the process to continue?
>
>[/color]

You can test with this function?
<?
function re-fresh ($time, $topage) {
//$time in sec
echo "<meta http-equiv=\"refresh\" content=\"{$time}; url={$topage}\"
/> ";
}


echo ' .... . tis may take sme timme';
re-fresh (10,"http://url/path/to/page");
?>

Jim Hoagland
Guest
 
Posts: n/a
#4: Jul 17 '05

re: how to refresh the screen


header("location url");exit: will not work after you use the echo statement
because this forces the headers to be sent. You will get an error message
"Headers already sent".

Also remember that a meta refresh must appear in the <head> section of your
html, so a function such as f700b's cannot be called from anywhere in your
PHP code.

ECRIA
http://www.ecria.com


Closed Thread