Forum Moderators: coopster

Message Too Old, No Replies

Running PHP from an .html file

         

vphoner

1:12 am on Jun 22, 2006 (gmt 0)

10+ Year Member Top Contributors Of The Month



I am relatively new to PHP. Is there a way to call a PHP routine in an .html extension file? I know that you can do this if the extension is PHP.

The reason I ask is that all my pages are indexed by google with an .html extension, and I don't want to have to change them all to .php extension.

When I put <?php
***code here**
?>
in an .html file, it does not work. Only works when the file extension is .php.

Is there anyway to get an .html file to run php code? (this assumes that the .html file is the first one called, and not called by a .php file).

jatar_k

1:23 am on Jun 22, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



you can have the html extension parsed for php, fairly easy with Apache

eelixduppy

2:55 am on Jun 22, 2006 (gmt 0)



Refer to this thread [webmasterworld.com] for more information. There are also many other threads at WebmasterWorld on the issue. Make sure that this is entirely necessary to do because it will require more server resources to parse every html page--even the pages that have no php code within to parse. Good luck!