agravayne Posted July 19, 2007 Share Posted July 19, 2007 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 Quote Link to comment Share on other sites More sharing options...
chigley Posted July 19, 2007 Share Posted July 19, 2007 Read up on output buffering. Quote Link to comment Share on other sites More sharing options...
agravayne Posted July 19, 2007 Author Share Posted July 19, 2007 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? Quote Link to comment Share on other sites More sharing options...
dbo Posted July 19, 2007 Share Posted July 19, 2007 Yucky, sounds like you should rewrite some code 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. Quote Link to comment Share on other sites More sharing options...
agravayne Posted July 20, 2007 Author Share Posted July 20, 2007 Have narrowed this down to a point when I am making an XML call to an external caller then creating a new object from the variable in the returned result. The Code is running from within the IFRAME. Quote Link to comment Share on other sites More sharing options...
agravayne Posted July 23, 2007 Author Share Posted July 23, 2007 OK this seems to be an IE problem as this behaviour is not happening in Firfeox? Quote Link to comment Share on other sites More sharing options...
btherl Posted July 23, 2007 Share Posted July 23, 2007 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.. Quote Link to comment 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.