Reply to Re: php in ".html" documents

Your name:

Reply:


Posted by Andrew DeFaria on 11/11/51 11:19

Randy Jackson wrote:

> You seem to feel pretty vociferously that it's a bad idea to embed php
> within .html files, or any other files for that matter. I'd like to
> get some idea as to why you feel this is such a horrible idea. For me,
> I'd just as soon end users didn't know they were looking at a php
> page, which is why I tend to use the .htaccess fix.
>
> So, what's your reasoning for feeling it's such a bad idea? I'd like
> to know. If there's a good reason not to do this, then I'll stop.

Why do you name a file .html? I mean why not choose the extension of
..foo? Why does Windows name executables .exe and Excel files .xls?
Simple, to indicate and distinguish that this file is different and or
processed differently than other files. IOW there's a reason and that is
indeed the reason. There really doesn't need to be another reason now
does there?

However the server will also be taxed in to parsing all .html files
looking for executable PHP code if you configure it that way. Seems like
a waste of processing time to me. There are also things such as "server
parsed html" normally named .shtml. Why is that? I mean why not make all
..html files the same as .shtml files? Well as the docs say you don't
want the server have to parse each html file as if it were a .shtml file
- it's wasteful. How then is this different for PHP?

And there may be some additional exposure to a security problem by doing
this (This I'm not as sure about - IOW it's probably harmless from a
security perspective).

Finally I fail to see why there is such push to use a sledge hammer
approach to fix a problem that really has a quite definite direction for
a proper solution. Is renaming a few files that hard to do? Is finding
links to those pages that hard to do? A simple script run over the set
of .html files seems like probably something much simpler of a script
than most scripts that people are writing here in PHP pages! Come on
people, can't you program? If not then what are you doing in a PHP
newsgroup?!?

The time spent arguing why renaming the files involved from .html ->
..php and finding and adjusting any links to it properly is probably a
lot less than the time, energy and effort spent here justifying why a
sledge hammer approach is preferred. It always amazes me how people
spend more energy avoiding a task then actually doing it!
--
I used to have a handle on life, then it broke.

[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

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