Re: Output Control

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



When PHP is used to serve pages it won't output anything until it is completely finished with execution. If you're trying to show 10 numbers with a one second delay you'd probably need to use refresh tags and a hidden field (or sessions) to loop back to the same page with each "second". I.e.

<?php

error_reporting(E_ALL);
session_start();
$time = &$_SESSION['time'];
$time++;
$delay = 1;
$wait = 10;

if ($time < $wait) {
echo "<meta http-equiv=\"refresh\" content=\"$delay\";url=\"{$_SERVER['PHP_SELF']}\">";
echo "<form><input type=\"hidden\" name=\"time\" value=\"$time\">$time</form>";
}


?>

--
PHP Windows Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [PHP Database Programming]     [PHP Install]     [Kernel Newbies]     [Yosemite Forum]     [PHP Books]

  Powered by Linux