sugarboy Posted February 20, 2010 Share Posted February 20, 2010 Hi Evryone, We have developed website which has a trigger a progress when performed an action on it, we have used flush and ob_flush to regularly display the updated progress bar on the webpage. It works fine when i access the website the same work, but when accessed the website from a remote host or which is in other network, the progress is not is displayed, its only getting displayed when it reached 100% Could you please help to resolve the problem... Thanks, Sagar Quote Link to comment https://forums.phpfreaks.com/topic/192740-flush-and-ob_flush-does-not-work-when-access-the-wesbite-from-remote-host/ Share on other sites More sharing options...
salathe Posted February 20, 2010 Share Posted February 20, 2010 Not without seeing what you're currently doing (some code please). Quote Link to comment https://forums.phpfreaks.com/topic/192740-flush-and-ob_flush-does-not-work-when-access-the-wesbite-from-remote-host/#findComment-1015330 Share on other sites More sharing options...
sugarboy Posted February 21, 2010 Author Share Posted February 21, 2010 <style> ,.progress_wrapper {width:400px;border:2px groove #ccc;position:absolute;top:280px;left:40%;margin-left:-100px;} .progress {height:20px;background-color:green;} </style> <body> <? $width = 0; // the starting width $width_per_iteration = 400 / $nooftests; while ($currexeccnt <= $nooftests ){ $width = $width_per_iteration * $currexeccnt; ?> echo '<div class="progress_wrapper"> <div class="progress" style="width:' . $width . 'px;"></div> </div>'; <? ob_flush(); flush(); } ?> </body> This is code the variables nooftests and currexeccnt will retrieved by perfroming some action on the server ..... so evrytime currexeccnt increases the progress bar width increases...... Hopefully i can get a solution now.......... Thanks, Sagar Quote Link to comment https://forums.phpfreaks.com/topic/192740-flush-and-ob_flush-does-not-work-when-access-the-wesbite-from-remote-host/#findComment-1015514 Share on other sites More sharing options...
PFMaBiSmAd Posted February 21, 2010 Share Posted February 21, 2010 Either your web server is buffering the output or you perhaps have a proxy server that is buffering the output. You would need to disable or satisfy all the buffering involved. If this for a general purpose application, you must also satisfy the minimum-block-length requirement of the different browsers. Short answer: Web servers simply are not designed to operate this way. You should be using AJAX and have the client make periodic http requests to the web server to get the current status. Quote Link to comment https://forums.phpfreaks.com/topic/192740-flush-and-ob_flush-does-not-work-when-access-the-wesbite-from-remote-host/#findComment-1015518 Share on other sites More sharing options...
teamatomic Posted February 21, 2010 Share Posted February 21, 2010 I'm confused(happens a lot) as to why you close out php, echo a statement with a var in it then start php again to out put the buffer. HTH Teamatomic Quote Link to comment https://forums.phpfreaks.com/topic/192740-flush-and-ob_flush-does-not-work-when-access-the-wesbite-from-remote-host/#findComment-1015524 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.