Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

partial display and exec output

Status
Not open for further replies.

bfdi533

Programmer
Jan 7, 2005
3
US
I have a script that is being called from shell_exec and it runs for about 15 seconds.

I need to display the first part of the web screen and give a message like "this will run for 15 seconds, please be patient until it completes." I have tried to put this into the HTML before my PHP code but it does not display in the browser until the shell_exec completes.

How can I get the HTML to display and then run the shell_exec and then display its results?
 
The webserver is probably buffering the output. You could force some whitespace chars down to make it flush the buffer.
Code:
print str_repeat(" ",8192);
 
You can try using the flush() command and/or output buffering, but PHP really wasn't designed with this type of functionality in mind.

Ken
 
Thanks for the tips. I ended up doing the following, which works great:

echo str_repeat(" ", 300);
flush();


Thanks again.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top