473,320 Members | 1,823 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Nested SSI with passed variable


I'm trying to implement a nested SSI file that has in it the line:

<!--#include virtual="<!--#echo var='VAR_location'-->pagelinks.txt" -->

where VAR_location is a variable set in the "calling" file. (I.e., the
original file sets VAR_location equal to a directory path, then #includes
the file in which the above line appears). I can #echo the variable
correctly from the included file, and typing the directory path explicitly
in this #include generates the correct result, but the #include directive
as written above generates "[an error occured while processing this
directive]" error. I don't know much about scripting, so there might be
some really fundamental error in my syntax with the quotes, or something.
Anyone care to enlighten me? TIA.

D.

Dennis M. Straussfogel, Ph.D.
Aerospace Engineering Consultant
Jul 20 '05 #1
2 2538
Dennis M. Straussfogel wrote:
I'm trying to implement a nested SSI file that has in it the line:

<!--#include virtual="<!--#echo var='VAR_location'-->pagelinks.txt"
-->


include directives are parsed before any script is executed on your web
server

--
William Tasso - http://WilliamTasso.com
Jul 20 '05 #2
In article <dm******************@news.abccom.bc.ca>, dm*@bcgroup.net
(Dennis M. Straussfogel) wrote:
I'm trying to implement a nested SSI file that has in it the line:

<!--#include virtual="<!--#echo var='VAR_location'-->pagelinks.txt" -->

where VAR_location is a variable set in the "calling" file. (I.e., the
original file sets VAR_location equal to a directory path, then #includes
the file in which the above line appears). I can #echo the variable
correctly from the included file, and typing the directory path explicitly
in this #include generates the correct result, but the #include directive
as written above generates "[an error occured while processing this
directive]" error. I don't know much about scripting, so there might be
some really fundamental error in my syntax with the quotes, or something.
Anyone care to enlighten me? TIA.


Okay, I've answered my own question. For those more neophyte than me that
might be wondering, the solution is to set an new variable in the included
file

<!--#set var="pagelinks" value="pagelinks.txt" -->

then concatenate the two variables in the #include directive (and get rid
of the #echo altogether, which I suspected didn't make sense to begin
with)

<!--#include virtual="$VAR_location$pagelinks" -->

Viola! There is probably a very simple way that experienced scripters
would use to do the concatenation without defining a new variable, but
this works.

Dennis M. Straussfogel, Ph.D.
Aerospace Engineering Consultant
Jul 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: r rk | last post by:
I am trying to write a utility/query to get a report from a table. Below is the some values in the table: table name: dba_daily_resource_usage_v1...
4
by: Vedanta Barooah | last post by:
greetings.... in a python nested class is it possible to change the value of the parent class's variable without actually creating an instance of the parent class, consider this code: class...
3
by: Erik Bongers | last post by:
Hi, Nested classes only seem to be able to access static members of the surrounding class : class SurroundingClass { public: class InnerClass { public:
12
by: abs | last post by:
Hi all. The example code is here http://instaltech.com.pl/_drzewo/test.html. I'd like to create a function which will have <li> object (id="myLI" in example code) passed as a parameter and will...
2
by: Quinnie | last post by:
Hi, I have a homework assignment that I'm so confused and really need help with. Here's the description, any help would be appreciated. Thanks! Assume we have a statically-scoped language...
2
by: William Ahern | last post by:
So, I recently learned that Solaris doesn't, or doesn't seem, to provide err.h. On some platforms err.h provides simple wrappers for error printing to stderr. One of which, err(), has this...
37
by: Tim N. van der Leeuw | last post by:
Hi, The following might be documented somewhere, but it hit me unexpectedly and I couldn't exactly find this in the manual either. Problem is, that I cannot use augmented assignment operators...
78
by: Josiah Manson | last post by:
I found that I was repeating the same couple of lines over and over in a function and decided to split those lines into a nested function after copying one too many minor changes all over. The only...
1
by: Goldie | last post by:
Can anyone offer advice on how to do a nested loop with vb I need the loop nested in the main loop to be passed a variable from the parent loop for SQL purposes. eg: parent selects all...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.