Log in

View Full Version : htm to php



viktor
11-15-2006, 04:41 AM
Is there an easy way to convert simple html code to php?

v1k

tech_support
11-15-2006, 06:15 AM
Yep. Change the extension from .htm or .html to .php :D

djr33
11-15-2006, 06:21 AM
php doesn't do ANYTHING to anything that isn't in <?php ... ?> tags. (and I think there are other tags as well... <? ... ?> perhaps? <% ... %>? etc.)

Just changing the file extension will do fine.

Then you can add any php code you like in addition to the html source, just by putting it in the php brackets.

That's it

BLiZZaRD
11-15-2006, 08:15 AM
If your server supports php that is :)

Alternatively you can keep the .htm extension and still use php tags within by adding these 2 lines to your root .htaccess:



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