You can run PHP code in .html/.htm files by changing the .htaccess file.
To change the .htaccess file:
AddHandler cgi-script .html
SetEnv PHP_EXTENSION .html
AddHandler cgi-script .htm
SetEnv PHP_EXTENSION .htm
Article ID: 423
Created On: Mon, Mar 16, 2015 at 3:36 PM
Last Updated On: Thu, Apr 23, 2015 at 12:20 PM
Online URL: https://www.heartinternet.uk/support/article/can-i-put-php-code-in-html-or-htm-files.html