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

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.

Was this answer helpful?

 Print this Article

Also Read

Will there be ads (advertisements) displayed on my site?

NO, there are no advertisements displayed other than what you place yourself.

How do I run my own CGI/perl programs?

Place your CGI programs in the cgi-bin directory. Be sure to upload them in ASCII mode. Make...

What permissions should I run my Cgi scripts under?

All CGI scripts should be placed in the CGI-BIN and set to chmod 755.

What permissions will I need to set my CGI scripts to for them to function properly?

ALL cgi scripts MUST be chmod 755. This does not apply to PHP scripts. Just the scripts you place...

What is CURL?

A command line tool for getting or sending files using URL syntax. Since CURL uses libcurl, it...