Re: [PHP] Include Files in HTML

2009-09-06 Thread Ashley Sheridan
On Fri, 2009-09-04 at 18:21 -0500, phphelp -- kbk wrote:
 On Sep 4, 2009, at 5:03 PM, sono...@fannullone.us wrote:
 
  Depends on what you are including. The only tags that can be  
  inside the
  head are base, link, meta, script, style,  and title.
  Everything else is either body or prologue.
 
  I meant PHP includes like this one:
  ?php @include_once(/home/passwords/login.php); ?
 
 We know what you mean. Read the responses more carefully, as they are  
 telling you what you need to know.
 
 For simplification: The INCLUDE commands put the contents of the  
 INCLUDed file into this file, just as if as you had typed it in there.
 
 Ken
 
It's good to remember that PHP isn't inserted into HTML, but the other
way round. PHP can output HTML, but is often used to output many other
formats, from images to xml to documents.

Thanks,
Ash
http://www.ashleysheridan.co.uk




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



[PHP] Include Files in HTML

2009-09-04 Thread sono-io
	In my readings, I've run across examples showing include files being  
called from within the head/head tags, and other examples showing  
them called within body/body.  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



RE: [PHP] Include Files in HTML

2009-09-04 Thread Bob McConnell
From: sono-io at fannullone.us

   In my readings, I've run across examples showing include files
being  
 called from within the head/head tags, and other examples showing

 them called within body/body.  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?

Depends on what you are including. The only tags that can be inside the
head are base, link, meta, script, style,  and title.
Everything else is either body or prologue.

The full specs can be found at
http://www.w3schools.com/tags/default.asp.

Bob McConnell

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



RE: [PHP] Include Files in HTML

2009-09-04 Thread Joost
Bob McConnell wrote:

 From: sono-io at fannullone.us
 
 In my readings, I've run across examples showing include files
 being
 called from within the head/head tags, and other examples showing
 
 them called within body/body.  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?
 
 Depends on what you are including. The only tags that can be inside the
 head are base, link, meta, script, style,  and title.
 Everything else is either body or prologue.
 
 The full specs can be found at
 http://www.w3schools.com/tags/default.asp.
 
 Bob McConnell

Sure enough. What the OP might not have realized:

In the end, what PHP evaluates to, is a stream of html, script, css etc 
text/data, which is sent to the browser. PHP's include( file ) statement 
inserts the content of file here-and-now. You can even put the include 
statement within a for loop in order to include something multiple times... 
In that sense it is more like a /function/ and really different from cpp's 
#include /directive/.

file can contain PHP code, which is evaluated as if it was here-and-now in 
the including PHP file; it can contain text/data, which is appended to the 
text/data stream being produced.

All in all, to PHP the spot of file inclusion is not interesting, as long as 
the resulting PHP code and/or stream data is meaningful.

Now back to you, Bob :-)

Regards,
Joost.

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



Re: [PHP] Include Files in HTML

2009-09-04 Thread sono-io


On Sep 4, 2009, at 1:05 PM, Bob McConnell wrote:

Depends on what you are including. The only tags that can be inside  
the

head are base, link, meta, script, style,  and title.
Everything else is either body or prologue.


I meant PHP includes like this one:
?php @include_once(/home/passwords/login.php); ?

Frank

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



Re: [PHP] Include Files in HTML

2009-09-04 Thread Tommy Pham
- Original Message 
 From: sono...@fannullone.us sono...@fannullone.us
 To: PHP General List php-general@lists.php.net
 Sent: Friday, September 4, 2009 12:57:08 PM
 Subject: [PHP] 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 
html, then all your includes goes before html.  If you want to have the 
modular approach of including css  js files inside the head 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 head.  If you want to 
make use of chunked encoding, you can including the rest within the body.

Thus, include everything before html 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 /html  (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



Re: [PHP] Include Files in HTML

2009-09-04 Thread Tommy Pham
- Original Message 
 From: Tommy Pham tommy...@yahoo.com
 To: php-general@lists.php.net
 Sent: Friday, September 4, 2009 4:11:31 PM
 Subject: Re: [PHP] Include Files in HTML
 
 - Original Message 
  From: sono...@fannullone.us 
  To: PHP General List 
  Sent: Friday, September 4, 2009 12:57:08 PM
  Subject: [PHP] 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



Re: [PHP] Include Files in HTML

2009-09-04 Thread phphelp -- kbk

On Sep 4, 2009, at 5:03 PM, sono...@fannullone.us wrote:

Depends on what you are including. The only tags that can be  
inside the

head are base, link, meta, script, style,  and title.
Everything else is either body or prologue.


I meant PHP includes like this one:
?php @include_once(/home/passwords/login.php); ?


We know what you mean. Read the responses more carefully, as they are  
telling you what you need to know.


For simplification: The INCLUDE commands put the contents of the  
INCLUDed file into this file, just as if as you had typed it in there.


Ken

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