How to include PHP code in .htm/.html pages?

August 27, 2011     0 comments

In order to include and execute PHP code in .htm/.html pages, you should set PHP as the default handler for these pages. You can easily do this by adding the following line to your .htaccess file:
 
AddHandler application/x-httpd-php52 .php .htm .html
 
Of course, you should make sure that your PHP code is correct and is placed between the opening <?php and the closing ?> PHP tags.

How helpful was this article to you?

FraudLabs Pro Secured Seal