Re: Include files....

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

 



On 5/18/07, Robert Cummings <robert@xxxxxxxxxxxxx> wrote:
On Fri, 2007-05-18 at 22:31 +0200, Tijnema ! wrote:
> On 5/18/07, Robert Cummings <robert@xxxxxxxxxxxxx> wrote:
> > On Fri, 2007-05-18 at 16:20 -0400, Jason Pruim wrote:
> > > On May 18, 2007, at 4:12 PM, Tijnema ! wrote:
> > >
> > > >>
> > > >>
> > > >> Thanks in advance for helping me through my obvious friday afternoon
> > > >> brain fart...
> > > >>
> > > >>
> > > > I guess you forget that defaults.php is a php file and needs to start
> > > > with <?php and end with ?>
> > > >
> > > > Tijnema
> > >
> > > Well there it is... The Brain fart... Or misunderstanding... I
> > > thought since I was calling it within another php script that I
> > > didn't have to include the <? ?> tags? Obviously I was wrong...
> >
> > You don't need to close the PHP context with ?>
> >
> > PHP does it for you when it hits the end of the file... this is a
> > feature.
> >
> > Cheers,
> > Rob.
>
> Yes, it does, but well, doesn't it look nice an ending ?> ??

Mostly, it looks like a dangling piece of rubbish. I never add the
closing ?> on a source-only file. And since I never mix code with
content... I never see ?> in my files *grin*.

The code generated by the template compiler has the appropriate closing
tags though... and of course since it's generated, it's a run-time soup
of HTML and embedded PHP code :)

Cheers,
Rob.

Mostly for the very basic sites, I put HTML code at the end of my
file, so i don't have to echo it and think about quotes. And a lot of
times, i also have HTML in front of my code, or when using sessions,
in between like this:
<?php
session_start();
?>
<html><head><title>Test</title></head><body>
<?php
// Some PHP code here
?>
</body></html>

And then, the ?> is a must :)

Tijnema

--
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