Page 1 of 1

Please Help- PHP Shown on HTML page

Posted: Fri Jul 29, 2005 11:09 pm
by hostresponse
Greetings,

I was hoping a fellow forum member could help me out.

I came across a forum post (forgot to bookmark)showing a piece of code that could be inserted into my htaccess file, which would allow a php include tag(s) to be displayed on a file saved as .html.

Ex:

<?php
include ("filename.php");

?>

Thanks in advance,

Hostresponse

Posted: Fri Jul 29, 2005 11:16 pm
by s.dot
you could always use htmlentities

Code: Select all

$string = htmlentities("<? this is php");
echo $string;
or, when writing your html, convert the special characters yourself

Code: Select all

&amp;amp;lt;? this is php ?&amp;amp;gt;

Posted: Sat Jul 30, 2005 9:02 pm
by feyd
I think he's referring to running .html files as PHP

Code: Select all

AddType application/x-php .php .html
I believe.. refer to the "install.txt" file that comes with a php download for specifics.