Click to See Complete Forum and Search --> : Server Side Includes


rayharper4
12-16-2003, 12:51 PM
Is it possible to insert an ssi with variables? If so, how? I have a template that I'm using were I want to change the navigation, based on where the page is located on the site. I am using ssi's but so far have not been able to pass variables to the include. For example:

<!--include file="ABCNavigation.htm"-->
<!--include file="DEFNavigation.htm"-->

I'd like to use

Navigation=ABCNavigation.htm
<!--include file=$Navigation-->

however, <script> does not support this. How can I pass a varible to an include?

pukka
12-16-2003, 03:23 PM
you can use php.


<?php

$navigation = "abcnavigation.html";
include [$navigation]; ?>




<?php

$navigation = "abcnavigation.html";
include "[$navigation]"; ?>



try either one of those.

rayharper4
12-16-2003, 03:26 PM
Thanks. It's working

PeOfEo
12-16-2003, 07:51 PM
why are you passing a vairble w/ an include though? Isn't there an easier way, such as a query string, or just storeing it in a data base or using a session variable? What are you trying to accomplish though the use of an include?