Wednesday, August 18, 2010

How to Enable PHP Inside HTML Pages

php code can be embedded within html pages within the tags:
<?php echo "my php code"; ?>

However, and depending on the server that you are using, this must be enabled. On apache2, you can edit the .htaccess file to include:
AddType application/x-httpd-php .htm .html

I added this line to the .htaccess on my website's root directory.


Cite as:
Saad, T. "How to Enable PHP Inside HTML Pages". Weblog entry from Please Make A Note.


  1. Great stuff for an begineer. Thanks.

  2. Good info. Thanks.

  3. Iam too an beginner in PHP. This is the first topic we will be learning in php. PHP is a scripting language. Scripting is using of predefined functions.

  4. Hellow sir thanks for this useful information....

  5. although websites we backlink to below are considerably not related to ours, we feel they are actually worth a go through, so have a look