Jump to content

No output being sent until function has finished


agravayne

Recommended Posts

Hello,

 

Thi is a difficult one to explain but what we basically have a a very convoluted set of functions that call each one after the other and create an object and return that to a further script that then displays a map made from the variables returned wich is printed into an IFRAME. This can sometimes take some time as it has to retreive a lot a variables.

 

What I am trying to do is get some feedback as the scripts is running so the user has something reason why the page is taking so long.

 

I have various print commands through out the scripts, loops and functions. No matter where they are the output is only sent to the screen after all the functions are called and the resulting object is returned. This is true even if I put in a simple print command before the first function is called.

 

Has anyone got any ideas what might be happening.

 

Many thanks

Scott

Link to comment
Share on other sites

Yeah I guessed it was to do with this but no changes I am making in this are working. For example after each print statement I have tried ob_flush(); but that still has no effect. I think that even the ob_flush command is not running until the function is finished?

Link to comment
Share on other sites

Yucky, sounds like you should rewrite some code :P

 

Why don't you place some of the function calls in the iframe you're calling? That way the rest of the page can load and the work is pushed in the background... at least in a sense.

Link to comment
Share on other sites

Compression (such as mod_gzip or zlib.output_compression) will buffer output, even if php is not buffering it.  Even if you have zlib output compression enabled in the config but disable it at runtime, your output will STILL be buffered.

 

You might want to try ob_implicit_flush() if you haven't already..

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.