Forum Moderators: coopster

Message Too Old, No Replies

running php on .shtml pages

can you do php and server side includes on the same page

         

Chicken Juggler

7:31 pm on Oct 21, 2004 (gmt 0)



I need to make some changes on a site but they use .shtml pages and have an elaberate include system they use. I have php I need to add to the page. I know I could just use php includes but that would be a lot of work to switch over the way they have it.

I'm thinking it is one or the other. Normaly if it is .html i just change the .htacces file to run .html files through the php engine.

StupidScript

9:24 pm on Oct 21, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You CAN use .htaccess to run .shtml files through the PHP parser. Not much of an issue, except as follows:

Apache will parse a .shtml file then send it through PHP (or the other way around), as opposed to just using the one parser, so there's a little extra server overhead involved. If your site is not >500,000 hits-per-day busy, you shouldn't worry about the extra overhead.

RTMac

9:55 pm on Oct 21, 2004 (gmt 0)

10+ Year Member



I've seen this question answered in another forum. I thought it might come in handy someday so I saved it.

I haven't tested it, but it's just a mime code added to the html page. Here it is:

<MIME TYPE Extension application/x-httpd-php.html>

(or)?

<MIME TYPE Extension application/x-httpd-php .html>

The difference in the two is the second one has a space after php. I'm not sure which is correct. Like I said, I haven't tested this out yet.

coopster

10:26 pm on Oct 21, 2004 (gmt 0)