Re: Include Files in HTML

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



----- Original Message ----
> From: Tommy Pham <tommyhp2@xxxxxxxxx>
> To: php-general@xxxxxxxxxxxxx
> Sent: Friday, September 4, 2009 4:11:31 PM
> Subject: Re:  Include Files in HTML
> 
> ----- Original Message ----
> > From: "sono-io@xxxxxxxxxxxxx" 
> > To: PHP General List 
> > Sent: Friday, September 4, 2009 12:57:08 PM
> > Subject:  Include Files in HTML
> > 
> >     In my readings, I've run across examples showing include files being 
> called 
> > from within the tags, and other examples showing them called 
> > within .  I've always put them in the header section myself, but I 
> > was wondering if one is better than the other, or is it just personal 
> > preference?
> > 
> > Frank
> > 
> > --PHP General Mailing List (http://www.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php
> 
> Depends on your application design and/or your desired result.  If you design 
> your application to do all processing before output is sent starting with 
> , then all your includes goes before .  If you want to have the 
> modular approach of including css & js files inside the  element, you 
> don't have to worry about going back to changing every single output file when 
> you decide the change your layout or javascript framework.  It also makes your 
> code page a bit cleaner when you do use include in the .  If you want to 
> make use of chunked encoding, you can including the rest within the .
> 
> Thus, include everything before  gives you a slight pause 'waiting for 
> reply...' in the status bar before the client even begin to download anything.  
> When includes are scattered all over, server processes some sends the web 
> browser info, here go fetch some more (css, js, images) until the the last 
> buffered output is sent   (that is if your page is compliant ;)
> 
> Regards,
> Tommy
> 
> 
> -- 
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php

Forgot to mention a few things, if your app is sophisticated enough to require header settings (content-type, etc), those include have to go before the buffered output is sent.  Also, you want to make use of chunked encoding, you cannot use/specify content-length in the header.


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux