Forum Moderators: coopster

Message Too Old, No Replies

nested SSI and PHP woes

         

kdeleon

2:17 pm on Nov 4, 2005 (gmt 0)

10+ Year Member



I am trying to use a nested SSI (SSI with a call to another SSI inside it) on my index page, but my index page is a .php file. I think the problem I am running into is that the second SSI is not being parsed due to the page being a php page. Any suggestions? By the way, the nested SSI file works fine on the other .html pages.

We have added SSI to the apache server as a parsable extension, and that is what made the nested SSI's work on the html pages, but it still will not work on the php pages like our index.php page. Thanks

StupidScript

5:43 pm on Nov 4, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to the forums, kdeleon!

Is there an issue with using PHP includes on the PHP pages, or is there some reason why you need to use SSI syntax?

<?php include "somefile.php"?>

instead of

<!--#include file="somefile.php" -->

kdeleon

6:09 pm on Nov 4, 2005 (gmt 0)

10+ Year Member



we are using php includes on the php pages to call...but the problem lies with the SSI that is called from within. My question, is there a way to make php recursively call SSI's.

On the index.php this is the call to top.ssi.
<? include 'SiteIncludes/new/top.ssi';?>

Within top.ssi there is an additional call to
<!--#include virtual="/SiteIncludes/new/topnav.ssi" -->

which fails. It works fine on the regular html pages when we call <!--#include virtual="/SiteIncludes/new/top.ssi" --> and then <!--#include virtual="/SiteIncludes/new/topnav.ssi" --> from within top.ssi.

I think the problem is that php is not recursive in what it is doing, and I was wondering if there was a way to make the server, I guess in a way, parse over the php twice so that it sees the second call from within top.ssi

StupidScript

6:29 pm on Nov 4, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



How about adding a little something to an .htaccess file?

DefaultType application/x-httpd-php

ForceType application/x-httpd-php

will cause all files to be run through the PHP engine (slight performance hit), regardless of their extension.

Or maybe add

.php
to your
AddHandler server-parsed .ssi
configuration entry to help the server-parsing engine find your embedded reference?

I don't know if the two (server-parsed and ForceType) will clash, but I suspect not. Has anyone had any problems running pages through multiple engines? I haven't ... yet. ;)