faqts : Computers : Programming : Languages : PHP : Installation and Setup : General

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

18 of 19 people (95%) answered Yes
Recently 9 of 10 people (90%) answered Yes

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).