PHP Code isn’t Working in my .html File

If your website requires advanced features than what HTML alone can offer, at some stage you may be required to use PHP. HTML and PHP are two different programming languages but they are designed to interact with each other in a single HTML page.

If you find that your PHP code is not working in your .html file, you may need to add the following line to your .htaccess file.

AddType application/x-httpd-php .html .htm

If you've never heard of a .htaccess before, it will be located in the root directory where your files are stored. You can use your favourite FTP program to connect to your account and edit this file, adding the quoted line shown above and saving the changes.