The easiest way to parse or run PHP code within an HTML page is to simply change the extension of the page from .html or .htm to .php!
Any regular text or HTML tags within the file will be totally ignored by PHP. Only the code contained within the PHP tags (<? ?>) will be processed by PHP.
If you have many HTML pages that contain PHP code and do not want to go through the trouble of renaming each file (although that method is preferred) you may make a change in the .htaccess file to parse all HTML files as PHP:
Open a text editor such as wordpad, notepad, nano, etc. and add the following line:
AddHandler application/x-httpd-php5 .html .htm