Bluehost Web Hosting Help

Executing PHP code within an HTML document

Problem:

Executing php code within a HTML document

Warning: Deprecated
This article is inaccurate or out of date and should not be used.

Solution:

Deprecated Executing php code within a HTML document is easy. Simply add this line to your main .htaccess file:

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

Then, you can insert code into your .html pages like this:

Code:
  <?php
                echo "hello world"
              ?>

Knowledgebase Article 234,440 views bookmark tags: addhandler addtype handler mime parse php sethandler


Was this resource helpful?

Did this resolve your issue?


Please add any other comments or suggestions about this content:





Recommended Help Content

How To Add Handlers To Change PHP Version - PHP Version Setup

This article will explain how to add a PHP handler to your .htaccess files. This is useful if you want to customize the version of PHP that runs your PHP files.

PHP pages do not display

If suddenly when you go to your page, you get nothing on the page. You can still get HTML to display, just not PHP. To serve HTML pages to browsers, we don't associate the Apache processes with your 2

Redirects that do not work due to PHP variables

The redirection of www.yourdomain.com/default.html or index.html to http://www.yourdomain.com/index.php?act=whatever redirects it to http://www.yourdomain.com/index.php%3fact=whatever In other words,

Related Help Content

How To Code a PHP Redirect - PHP Header Redirect

How do I redirect users to another page using PHP?

Create Custom MIME Types

This article will explain how to create MIME types.

Character sets in PHP

How to Set different character sets with PHP and HTML to display correctly.

Character sets in HTML

Instructions to set different character sets in HTML. Note: Not all character sets will be correctly rendered with this encoding format, but most will. You can find specific information about which ch

PHP Configuration for Addon Domain

How can I adjust the php settings specifically for an Addon Domain?

Manually editing your error pages

How to customize your html or php error pages.

How to Enable PHP FastCGI

This article explains how to enable FastCGI for PHP applications.

How To Configure The PHP Environment With PHP ini

How do I change the PHP environment for my site with php.ini?