Posted by Linux Jay on 01/12/06 04:05
On 2006-01-12, Domestos <never.you@mind.com> wrote:
> for example... which is better or more standard....
>
><html>
><head>
><title>title text</title>
></head>
><body>
> You name is <?php $name?>
></body>
></html>
>
> saved as index.html
>
> or
>
>
><?php
> echo '<html>';
> echo '<head>';
> echo '<title>title text</title>';
> echo '</head>';
> echo '<body>';
> echo 'Your name is '.$name;
> echo '</body>';
> echo '</html>';
> ?>
>
> saved as index.php
>
Personally, in that example I'd use the first style of coding, and save it as
index.php
I have my servers set to only parse .php files for PHP code, so if I saved it
as a .html file it wouldn't work. It saves looking for PHP when there is none,
probably doesn't make much of a difference though.
--
J
My Realm: http://www.myrealm.co.uk/
LORE: http://lore.myrealm.co.uk/
'Drink up. The worlds about to end.'
[Back to original message]
|