Jump to content

print while script is going


Imaulle

Recommended Posts

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!

Link to comment
Share on other sites

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();

 

 

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.