You can run PHP code in .html/.htm files by changing the .htaccess file.
To change the .htaccess file:
- Back up your .htaccess file
- Open your .htaccess file or create one in a text editor
- At the end of the file, paste this code:
AddHandler cgi-script .html
SetEnv PHP_EXTENSION .html
AddHandler cgi-script .htm
SetEnv PHP_EXTENSION .htm
- Upload the new .htaccess file to your server
- PHP code will now run in .htm and .html files