|
Posted by Jonathan N. Little on 02/08/07 01:14
John Hosking wrote:
> Jonathan N. Little wrote:
> [...]
>> <body>
>>
>> <?php
>> include('banner.php');
>> include('navbar.php');
>> ?>
>>
>> <h1>My Page</h1>
>> <p>
>> The rest of my page...
>> </p>
>>
>> <?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') ?>
Yep a typo.
>
> 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') ?>
Yes, can be, If the include is just static HTML it would be ok, but if
there is any scripting one should use PHP to prevent looking at PHP
source and only have the result visible. '.inc' many times is not
registered on server could be accessed directly as plain text. Would be
a bad thing if the include was the setup for accessing site's database, eh?
-- database.inc --
<?php
$user='admin';
$password='verysecret';
...
>
> Is that true? (Maybe it's obvious I'm not a php user...)
>
So bottom line is if just plain HTML, sure call the include
'something.html', but if has anything sensitive, better to use
'something.php'
--
Take care,
Jonathan
-------------------
LITTLE WORKS STUDIO
http://www.LittleWorksStudio.com
Navigation:
[Reply to this message]
|