Forum Moderators: open
you cannot use php on a page with html ext. You simply can not! :-)
Not strictly true, although for most people it is I guess. Like benevolent001 says, I believe you can get your web server to parse any file you like for PHP code - it is a web server setting (Apache). However, you need to add things (AddType...?) to your servers httpd.conf (Apache) file - but for people on shared hosting you probably don't have access to it.
you cannot use php on a page with html ext. You simply can not!
On the contrary, you most certainly can! :) In fact you only can if you are on a shared server running Apache and you can use a .htaccess file, or if you are on a dedicated server where you can directly adjust the configuration.
The basic .htaccess syntax for parsing all .html files for PHP is:
AddHandler application/x-httpd-php .html If you only want to make one file parsed for PHP, you can also specify it:
<Files myphppage.html>
ForceType application/x-httpd-php
</Files> This is placed in your .htaccess file in the document root. If you don't already have a .htaccess file, you can create a blank text file.