Return CGI Library
These are provided by the server software we use. As such they are of limited portability (Apache servers at least). However they
run fairly fast and are easy to use. :-)
The inclusion of variables (e.g. "last modified date" and current time...)
is covered on the variables page.
Here we're going to look at ways to include different files... and even scripts.
There are three basic commands:
<!--#include file="path to file"-->
This include takes a path FROM THE CURRENT DIRECTORY to the file you want to include. The path may NOT include ../ in it... so you can
only specify files in the current directory and subdirectories.
<!--#include virtual="webserver path to file"-->
Sometimes you run across a reference to a URI. I don't know what it's formally defined as, but for this page, we're going to define it
as the part of a URL after the "http://host" part. So the URI for this page is /gadgets/ssi.html or in UNIX terms, the path from the
root of the virtual webserver to the page being specified.
The virtual= parameter in this SSI is the URI to the file... so you can specify any file in your virtual webserver ... what isn't
commonly known/used is the fact that this can be a /cgi-bin/ reference or other special type of file (e.g. PHP :-). Not only
that, but you can pass parameters to your CGI programs, so CGIWRAP will work with this SSI.
<!--#exec cgi="webserver path to file"-->
This SSI is restricted to including the output from CGI programs. The "webserver path to file" is a URI again... which is why we
defined it. This SSI is restricted in that you can not pass any parameters to the CGI programs. That's fine for the counter gadget and
a few others, but for the complex gadgets (like cgiwrap) you will need to use the include virtual= format.
That's all for now!
|