I need real time otput from php to Browser....
For example: first i print on Screen HTML content... then i need register transaction and output on Screen registration-status....
But that don't works.... first register transaction and then pript on Screen HTML content and registration-status in one time....
Soory, if all not understand.... but i speek english very bad....
P.S. maby i need change some configuration in Apache or PHP
real time Output from php to Browser
Moderator: General Moderators
maybe I missed the point. Do you want to asure that partial results of your script are sent to the browser before the script's execution continues?
If so, flush() is your best chance.
http://www.php.net/manual/en/function.flush.php
If so, flush() is your best chance.
http://www.php.net/manual/en/function.flush.php
nope, all the manual says is: maybe it works, maybe not, depending on your webserver's and the client's configuration. It's still your best chance and worth a try 
e.g. my mozilla browser displays the first string long before sleep(10) is finished, while internet explorer refuses to display anything until the script is done :-S
But withboth browsers handle the partial data as expected 
e.g. my mozilla browser displays the first string long before sleep(10) is finished, while internet explorer refuses to display anything until the script is done :-S
But with
Code: Select all
<html><body><pre><?php
echo "first output\n";
flush();
sleep(10);
echo "second output\n";
?></pre></body></html>may also be that your script outputs something that browsers do not render immediately. Part of a table that is not fixed-size e.g. or parts of a <div> that has a relative position but no width-property or ... or ...
Try to encapsulate your output in a <p>...</p>-Block with no further styles before calling flush();
Try to encapsulate your output in a <p>...</p>-Block with no further styles before calling flush();