Forum Moderators: coopster

Message Too Old, No Replies

php in a html (.htm) file

on a widows iis server

         

Broadway

9:00 pm on Aug 5, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



My website's pages are static html (.htm files) on a Windows/iis server.

I'd like to include some php script on all of my website's pages. I don't have the option of renaming these pages .php because they are indexed by Google as .htm names.

I saw this in an old WW thread. It talks about asp but wouldn't it apply to php too?

>>
... Or alternatively, you need to tell iis that it should analyze and process .htm pages before it gets sent down to the client. To do that, you need to:

1. Start up Internet Service Manager
2. Select the web site you want to do the processing on
3. Right click on it and select Properties
4. Select Home Directory
5. If necessary, create an application
6. Press Configuration
7. Select .asp and press Edit
8. Copy down the information in the dialog
9. Press Cancel
10. Press Add
11. Use the file extension .htm, use all the other information that you copied down in step 8
12. Press OK to all the dialogs
13. Restart iis for good measure
<<

Would this be a solution?

eelixduppy

12:08 am on Aug 6, 2009 (gmt 0)



Sure you can change it so that .htm files are parsed as php.

As for including a php file on every page there is a directive for that. Take a look at auto_prepend_file [us2.php.net] for more information.

StoutFiles

12:52 am on Aug 6, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Why not use .asp?

Broadway

2:44 pm on Aug 6, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



No real reason, I know my server has php on it because of another project I did. The script I see for this project I want to work on is php. It just seems the easiest approach for me.