If you are using code in html file, chances are PHP versions 7+ may not be executing or running those code.  You will see the site returning download as file or sometimes showing template code.

How to fix this?

I have had success with running PHP 5.5 or 5.6 versions and i added this code to the .htaccess file. Remember both AddHandler and AddType must be present

AddHandler application/x-httpd-ea-php56 .htm .html .shtml
AddType application/x-httpd-php5 .php

If you have PHP 7+ versions , try this, most likely this wont work as Php 7 versions wont support this. You have to probably rename those html files to php files to run the code.

AddHandler application/x-httpd-ea-php73 .htm .html .shtml
AddType application/x-httpd-php7 .php