Hey everyone,
I'm a PHP newbie and have what probably is going to be a stupid question but I can't find examples or info on it. I have an HTML document and in that document I have an include statement <?php include("showme.php")?>. When I load the HTML document, the contents of the PHP file isn't displayed. If I put the appropriate include statement in another php file to load showme.php, it works. So is it possible to have an include statement that loads a PHP file embedded in an HTML document?
Thx
PHP include statement in an HTML document
Moderator: General Moderators
-
blackbeard
- Forum Contributor
- Posts: 123
- Joined: Thu Aug 03, 2006 6:20 pm
As far as i know php will not parse html files. You could do something like this but like the commenter said, that forces your server to parse every html file for php which increases the load on your server. If you change the extension of that html file to php it should work (with the adition of a semicolon (';') at the end of your echo statement).
Wayne
Wayne
Add this line to your .htaccess file:
But beware, your htm(l) documents will be treated as php !!!
Code: Select all
AddType application/x-httpd-php .htm .html