/    Sign up×
Community /Pin to ProfileBookmark

Server Side Includes

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?

to post a comment
HTML

3 Comments(s)

Copy linkTweet thisAlerts:
@pukkaDec 16.2003 — you can use php.

[code=php]
<?php

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

[/code]


[code=php]
<?php

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

[/code]


try either one of those.
Copy linkTweet thisAlerts:
@rayharper4authorDec 16.2003 — Thanks. It's working
Copy linkTweet thisAlerts:
@PeOfEoDec 17.2003 — 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?
×

Success!

Help @rayharper4 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.15,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...