| 1. |
How To Enable Php Parsing On Static Webpages (.html And .htm) Using .htaccess? |
|
Answer» If you want to execute dynamic PHP code on otherwise static .html and .htm webpages, you NEED to enable PHP PARSING on this type of webpage. To do this, SIMPLY add the following line to your .htaccess file and then you can include PHP code directly in the SOURCE code of your .html and .htm webpages. Make sure that you EMBED all PHP code inside opening and closing PHP tags (<?php and ?>). AddType application/x-httpd-php .html .htm Please note that you cannot use SSI and PHP parsing at the same time. But don´t worry: you can include PHP code in SSI enabled webpages, too. For this purpose you would need to paste the PHP code into a blank text document, save the file as whateveryoulike.php, upload it to your server and then include it with SSI: <!–#include virtual=”path-to/whateveryoulike.php” –> If you want to execute dynamic PHP code on otherwise static .html and .htm webpages, you need to enable PHP parsing on this type of webpage. To do this, simply add the following line to your .htaccess file and then you can include PHP code directly in the source code of your .html and .htm webpages. Make sure that you embed all PHP code inside opening and closing PHP tags (<?php and ?>). AddType application/x-httpd-php .html .htm Please note that you cannot use SSI and PHP parsing at the same time. But don´t worry: you can include PHP code in SSI enabled webpages, too. For this purpose you would need to paste the PHP code into a blank text document, save the file as whateveryoulike.php, upload it to your server and then include it with SSI: <!–#include virtual=”path-to/whateveryoulike.php” –> |
|