parsing php in .html

Support/Development for PHP
faris
Long Time Forum Regular
Long Time Forum Regular
Posts: 2321
Joined: Thu Dec 09, 2004 11:19 am

parsing php in .html

Unread post by faris »

Hi guys,

I have a customer who has a site with about 200 .html documents. They've asked me to make a certain adjustment that would be really easy if I could only "include" a snippet of html in each page. If they were php pages I would use use a require() and the job would be done.

I know I could rename the pages from .html to .php but this would have to be done manually for each page, letting Dreamweaver then update all the necessary links each time. It would be a serious pain in the bottom and take ages.

I was wondering if there were any bad security implications to using an apache configuration directive in the Plesk vhosts.conf or .htaccess for the site to tell it to parse .html as php as well as .php files?

The disadvantage would be that Dreamweaver probably won't play nice with php code in .html files (e.g. it won't display the included code like it will with a page ending in .php). Hmmm....

The alternative, I suppose, would be to rename all .html to .php on the server (nice and easy in Linux!), download them, then do a find and replace in Dreamweaver to change .html to .php in the source of each page. This option scares me a little as there's plenty of scope for it to all go wrong :-(

Does anybody have any other suggestions?
--------------------------------
<advert>
If you want to rent a UK-based VPS that comes with friendly advice and support from a fellow ART fan, please get in touch.
</advert>
Highland
Forum Regular
Forum Regular
Posts: 674
Joined: Mon Apr 10, 2006 12:55 pm

Re: parsing php in .html

Unread post by Highland »

I've never heard of any bad implications. You'd add a tiny bit of overhead in serving up otherwise static html pages but that's it.

If they have access to your file structure, parsing html with PHP would be the least of your problems.
"Its not a mac. I run linux... I'm actually cool." - scott
faris
Long Time Forum Regular
Long Time Forum Regular
Posts: 2321
Joined: Thu Dec 09, 2004 11:19 am

Re: parsing php in .html

Unread post by faris »

Well, in the end I renamed everything as on top of everything else it allowed me to have both the old and the new versions running in parallel.

It was a pain but worth it.

But it is good to know that I can do it in the future if I need to :-). Thanks.

Faris.
--------------------------------
<advert>
If you want to rent a UK-based VPS that comes with friendly advice and support from a fellow ART fan, please get in touch.
</advert>
Post Reply