Here's an example to illustrate the type of thing I'd like to do: Say I make a Perl script that, by default, outputs an HTML table containing the calendar of current month. It also includes a <prev> and <next> link. This calendar is then placed on an HTML page with SSI #exec cmd or #include virtual (depending on what works; I've discovered that you can't pass arguments with #exec cgi -- see below). So, if you click <next>, it should set the correct month (currently, that would be something like $month="2001/10") and then reload the page with that month instead of the current.
I know you can pass constant values like this:
<!--#exec cmd="/cgi_bin/calendar.pl 2001/10"-->
But what I'm looking for is the ability to do something like:
<!--#exec cmd="/cgi_bin/calendar.pl $month"-->
Obviously, this won't work (although, as I said above, I can't test anything yet, but I would be VERY surprised if it did), but it illustrates the principle.
I've looked "all over" for the answer to this, and the closest I've come is this page: [oreilly.com...] (under "Counting Days Until...")
There, they say you cannot pass arguments as part of an SSI exec cgi directive, but you can use #exec cmd instead and run the script as a Perl program and supply the arguments as regular command line arguments, like I do above.
But what if you want those arguments to change according to user input? Is this at all possible, and if so, how is it done?
I'm beginning to suspect that using cookies is the only way this is possible. Moreover, that would make it possible to have several such "gadgets" on one page, all keeping their individual settings on reload. The downside to this approach is that some users have disabled cookies. So I'd rather find a way that works for all.
And before you ask why I don't just do the whole page in Perl instead of using SSI: No, I don't want to do that. I use Dreamweaver and its Templates function to publish my pages, and intend to continue doing that if it's at all possible. If I can find a way to do what I describe above, all my dreams come true. :-)
[webmasterworld.com...]
Contains one line:
<!--#include virtual="/discussion.cgi?forum=13&discussion=640"-->
Then your cgi parses the arguments just like a form submission.
Cookies sounds like the only solution. You could also build up a set of default ssi files in a directory that cover 24-48 months out.
<!--#include virtual="/calendar.cgi?month=10&year=2001"-->
And so on for each month for the next many months. Then use those ssi's as your next, and last links in the calendar. (if your calendar will allow that type of modification).
Well, the calendar was just an example to illustrate the principles of what I'd like to do. It's all about transferring data from one instance of an SSI-included script to another, and it's becoming more and more clear to me that cookies is the way to go.
I'll just have to notify the more paranoid users that if they don't want to turn on cookies, they'll have to make do with less functionality. :-)
I've done this..but I'm not sure if it's exactly what you want. For example:
<!--#if expr="${HTTP_USER_AGENT} = /Slurp/" -->
<!--#set var="brtype" value="inktomi" -->
<!--#elif expr="${HTTP_USER_AGENT} = /Lynx/" -->
.....
The next SSI script that runs on that page has access to the "brtype" variable in the environment and can examine whatever value has been set to that variable. This works on my apache 1.3.6 server, I can't vouch for anything else...