Re: load the PHP script last on the page

From: Date: Thu, 31 Jul 2003 20:14:30 +0000
Subject: Re: load the PHP script last on the page
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-157806@lists.php.net to get a copy of this message
...or use flush() just before that piece of code, if that's the case (if you don't need its output to complete the page). The page will be sent, the browser will remain in the "page in progress" state until the whole script is done, but that shouldn't bother your users, since they have the whole page to look at by that time. Bogdan John W. Holmes wrote:
DougD wrote:
I have a page with a particular PHP section that takes quite a time to load. Is there a way I can delay that script to run after everything else has loaded. I suppose it may need to use Javascript????
You could use register_shutdown_function() to execute the code, providing you don't need any output sent to the browser. Do some testing as to whether PHP still waits for that function to finish or not, but I don't think it does.


« previous php.general (#157806) next »