on 7/8/01 10:58 PM, Steve Werby at [EMAIL PROTECTED] wrote:

> "Ben Bleything" <[EMAIL PROTECTED]> wrote:
>> I believe (and I'm sure someone will correct me if I'm wrong) that
>> whenever you 'include' or 'require' a file, it drops to regular HTML
>> mode... so, yes, you will need to use <?php tags at the beginning and ?>
>> tags at the ends =>
> 
> Think of the behavior of include() as copying the exact text from your code
> in the include'd file and pasting it as is into the calling code...a la
> paper and scissors.  There is no special transformation.  So if the code in
> the include'd file would have needed PHP codes if it was directly within the
> calling code then it needs it in the include'd file too and if it wouldn't
> have in the calling code then it won't in the include'd file.

from http://php.net/include

An important note about how this works is that when a file is include()ed or
require()ed, parsing drops out of PHP mode and into HTML mode at the
beginning of the target file, and resumes again at the end. For this reason,
any code inside the target file which should be executed as PHP code must be
enclosed within valid PHP start and end tags.

 -- mike cullerton



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to