In order to use php codes in a page with an extension other than .php, you need a server that supports .htaccess files.
What you have to do is to creat or edit the ".htaccess" file in the folder and add this line to it:
AddType application/x-httpd-php .html .htm
What does that code do?
That code will tell your server to search for php code(s) in .html and .htm files and execute them (only the folder and it's subfolder that has that edited ".htaccess" file).
So now if you go to that html file that contains php codes, it will be shown exactly like as if it was a php file...