Imaulle Posted December 17, 2010 Share Posted December 17, 2010 hihi, so I have the following, except it goes all the way up to server 400. Is there a way to make it print after each echo? As it is right now it will not print the entire list until all 400 servers are done echo "Server 01: " . count($server01->listaccts()) . " / 130" . "<br />" ; echo "Server 02: " . count($server02->listaccts()) . " / 130" . "<br />" ; echo "Server 03: " . count($server03->listaccts()) . " / 130" . "<br />" ; echo "Server 04: " . count($server04->listaccts()) . " / 130" . "<br />" ; echo "Server 05: " . count($server05->listaccts()) . " / 130" . "<br />" ; echo "Server 06: " . count($server06->listaccts()) . " / 130" . "<br />" ; echo "Server 07: " . count($server07->listaccts()) . " / 130" . "<br />" ; echo "Server 08: " . count($server08->listaccts()) . " / 130" . "<br />" ; thanks! Quote Link to comment https://forums.phpfreaks.com/topic/221927-print-while-script-is-going/ Share on other sites More sharing options...
JakeTheSnake3.0 Posted December 17, 2010 Share Posted December 17, 2010 Flush? http://php.net/manual/en/function.flush.php Quote Link to comment https://forums.phpfreaks.com/topic/221927-print-while-script-is-going/#findComment-1148464 Share on other sites More sharing options...
Imaulle Posted December 17, 2010 Author Share Posted December 17, 2010 soooo... I would need to do something like this: I tried this I think and it did not work :s echo "Server 01: " . count($server01->listaccts()) . " / 130" . "<br />" ; ob_flush(); flush(); echo "Server 02: " . count($server02->listaccts()) . " / 130" . "<br />" ; ob_flush(); flush(); echo "Server 03: " . count($server03->listaccts()) . " / 130" . "<br />" ; ob_flush(); flush(); echo "Server 04: " . count($server04->listaccts()) . " / 130" . "<br />" ; ob_flush(); flush(); echo "Server 05: " . count($server05->listaccts()) . " / 130" . "<br />" ; ob_flush(); flush(); echo "Server 06: " . count($server06->listaccts()) . " / 130" . "<br />" ; ob_flush(); flush(); echo "Server 07: " . count($server07->listaccts()) . " / 130" . "<br />" ; ob_flush(); flush(); echo "Server 08: " . count($server08->listaccts()) . " / 130" . "<br />" ; ob_flush(); flush(); Quote Link to comment https://forums.phpfreaks.com/topic/221927-print-while-script-is-going/#findComment-1148467 Share on other sites More sharing options...
JakeTheSnake3.0 Posted December 17, 2010 Share Posted December 17, 2010 Looking at the replies on the PHP manual page it might have something to do with your config. I just tested a simple script on my server and it didn't work either. Quote Link to comment https://forums.phpfreaks.com/topic/221927-print-while-script-is-going/#findComment-1148474 Share on other sites More sharing options...
PFMaBiSmAd Posted December 17, 2010 Share Posted December 17, 2010 Browsers and web servers operate on a request/response basis. They don't operate like a local application would. There are a number of reasons why a web server, php, the browser, and even proxy servers that might be between the two won't allow this to work. Once you get it working on one system it probably wont work on another. You should either write this as a local compiled application using C or a similar programming language or if you must use a browser/web server you should use AJAX to periodically make http requests to the web server to get and display any updated information. Quote Link to comment https://forums.phpfreaks.com/topic/221927-print-while-script-is-going/#findComment-1148482 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.