note 52863 added to function.flush
| From: | (Michael) | Date: | Sun, 15 May 2005 23:38:17 +0000 |
| Subject: | note 52863 added to function.flush | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-89471@lists.php.net to get a copy of this message | ||
It is a bit complicated to work with the funktion flush() and you have to experiment with it a bit.
So if you design a site which has a timeloop at the end that calls a other site via a form data
input (Data Submit) you have
to give something out to the buffer to get that new site loaden quick.
For example:
$instant=gettimeofday();
$timenow=$instant["sec"];//Start Time
//timeloop(e.g. for security_save after 30 min)
while (1) { echo "<b></b>";//Useless (only to quickload next
//or same Site when do a switch)
flush(); //giveout buffer
$instant=gettimeofday();
$timeactual=$instant["sec"]; //get Actual Time in Secs
$flag=(($timeactual>$timenow+$diff)? 1:0);//$diff=switchTime
if ($flag) { what_do_at_switch_Time();//Sec.Save etc.etc.
$timenow=$timeactual; } //Set new Start Time
sleep(5); //Or so...(Important)
} //End of while-Loop
So you can programm a security save or other function in your site and if you do a switch the upload
of the new or same site (the called site) works...
----
Manual Page -- http://www.php.net/manual/en/function.flush.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+52863
Delete: added to the manual -- http://master.php.net/manage/user-notes.php?action=delete+52863&report=yes&reason=added+to+the+manual
Delete: bad code -- http://master.php.net/manage/user-notes.php?action=delete+52863&report=yes&reason=bad+code
Delete: spam -- http://master.php.net/manage/user-notes.php?action=delete+52863&report=yes&reason=spam
Delete: useless -- http://master.php.net/manage/user-notes.php?action=delete+52863&report=yes&reason=useless
Delete: other reasons -- http://master.php.net/manage/user-notes.php?action=delete+52863&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+52863&report=yes
Search -- http://master.php.net/manage/user-notes.php