If you want to have your html files (*.htm, *.html etc) being run/parse by the web server as PHP files, here’s how you can achieve that.
Depending on how php is installed with your web server / web host, add this into your .htaccess file
For web servers using PHP as apache module:
AddType application/x-httpd-php .html .htm
For web servers running PHP as CGI:
AddHandler application/x-httpd-php .html .htm
Since I host with Hostgator which supports PHP5, instead of using the above, I had to use (notice the bolded 5)
AddHandler application/x-httpd-php5 .html .htm
And if’ you’re developing locally with XAMPP, you should use AddHandler instead of AddType
AddHandler application/x-httpd-php .html .htm
SAHARSH JAIN says
I tried evry solution out there but yours was really helpful to me thanks a lot