Entry
Can I use PHP and SSI in the same document?
Oct 25th, 2000 19:54
Brad Wood, Nathan Wallace, Jim Winstead
If you are running PHP as an Apache module, check out the virtual()
function. You cannot mix SSI and PHP content in the same document.
http://www.php.net/manual/function.virtual.php3
Alternatively, you can use #include virtual to include php code
fragments. eg:
test.shtml:
<HTML>
<HEAD>
<TITLE>Test PHP3 document</TITLE>
</HEAD>
<BODY>
<!--#echo var="DATE_GMT"--><p>
<!--#include virtual="/phptest/test1.php3"-->
</BODY>
</HTML>
and test1.php3
<?
phpinfo()
?>
give pretty much what you'd hope for (the date followed by a phpinfo
output).