heldenbrau Posted August 6, 2009 Share Posted August 6, 2009 I want some php includes in my shtml files. I have the following line added in the head section of my shtml page. <MIME TYPE Extension application/x-httpd-php.html> But when I open the page, the php doesn't work. The code is not displayed though, it is only displayed in the source. The code that is in the include is Code: [select] <?php session_start(); if (!isset($_SESSION['username'])) { $username=($_SESSION['username']); echo"You are logged in as $username"; } ?> Also what do I put as the include, is it <!--#include file="file.html"--> or <!--#include file="file.php"--> I am using PHP5 and Apache2.2 Link to comment https://forums.phpfreaks.com/topic/169091-reading-includes-that-are-in-php-from-shtml-pages/ Share on other sites More sharing options...
dreamwest Posted August 7, 2009 Share Posted August 7, 2009 # activate SSI for HTML and or SHTML file types AddType text/html .html AddType text/html .shtml AddHandler server-parsed .html AddHandler server-parsed .shtml AddHandler server-parsed .htm Link to comment https://forums.phpfreaks.com/topic/169091-reading-includes-that-are-in-php-from-shtml-pages/#findComment-892792 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.