Reply to Re: How to make navigation buttons appear on all pages?

Your name:

Reply:


Posted by Rik on 02/08/07 00:44

John Hosking <John@DELETE.Hosking.name.INVALID> wrote:

> Jonathan N. Little wrote:
>> <?php include('footer.php' ?>
>
> If the OP or any other folk try to use this, they should know that there
> is a parenthesis missing above. I think it should be
> <?php include('footer.php') ?>
>
> I'm also thinking that the included pages (like footer.php) don't really
> need to be .php pages, but could be .htm files instead, as in
> <?php include('footer.htm') ?>
> Is that true? (Maybe it's obvious I'm not a php user...)

Both true indeed. Allthough it really doesn't matter what the extension is
when it's included. It will all be treated as either raw output (html in
most cases, but offcourse thing like css or javascript are also possible),
or php between php tags.

In other words: even if the server isn't set up to normally parse .htm
files for php this will work:

---test.php---
<?php include('test.htm'); ?>
--------------

---test.htm---
hello
<?php echo 'world'; ?>
----------------

Looking at test.php you'd see 'hello world', looking at test.htm directly
you'll normally see the unprocessed php.

So no performance benefits to naming the files .htm, only a possible
security risk exposing code that's there. Offcourse, one should never put
php code like this in .htm files, unless one's willing to bug the server
by forcing it to parse .htm files for php too, which would mean a
noticable performance decrease for straight .htm files.
--
Rik Wasmus

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация