Page 1 of 1

Delay loading of PHP Includes

Posted: Wed May 21, 2008 1:27 pm
by user1776
Hello,

I am fairly new to PHP, coming over from C#/ASP.net, I am using PHP includes to reuse code and make my web pages easier to update. I have placed my sites header, footer, sidebar and main content in external php files and am using includes to add them to my pages.

The only problem I am encountering is that my main content include seems to be loading before all of the html is finished loading, causing it to show up in the top right corner then fly over to the middle of the page (where it belongs) a few seconds later.

I know in other languages you can tell includes/scripts not to load until all of the HTML is loaded, can anyone tell me how this could be done in PHP, or offer any other suggestions?

Thanks

Re: Delay loading of PHP Includes

Posted: Wed May 21, 2008 2:17 pm
by Christopher
There are a couple of ways to do that in PHP. You did not post code so it is difficult to know. It may also be a HTML thing rather than PHP. Maybe look into output buffering?