Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using SSI's globally

Status
Not open for further replies.

madcgimonk

Programmer
Oct 8, 2004
25
US
I have a chat script on the left side of all of my pages (or I am trying to get it that way, anyway) by using SSI.

Code:
<!--#include file="chat.cgi"-->

Works if I am in the main directory (yes, CGI's can be run outside of my cgi-bin). But when I am in a folder, like domain.com/folder1/ , the SSI fails because it can't find it.

How do I make the SSI use a full file path so I don't ever have to change the code? I heard there are 2 different types of SSI codes or something.
 
Hi.

I tried that and it's not working at all. I checked my file paths to ensure they are accurate without a doubt, and it is.

Any other ideas?

Thanks.
 
Here is more information:

The error was
Code:
unable to include file "/home/sulferic/public_html/cgi/footer.shtml" in parsed file /home/sulferic/public_html/cgi/tutorials/index.shtml

using
Code:
<!--#include virtual="/home/sulferic/public_html/cgi/header.shtml"-->

The file header.shtml does exist in the directory I call it from because all other files in the main directory /cgi/ can read it just fine. But /cgi/tutorials and any other folders error out.

Thanks.
 
try them all in same directory, and then move the references

header calls index, but fails to call footer which is in the same directory as header

I've been looking at that for a while, and it's been looking back
--Paul

cigless ...
 
Since it's a CGI file, put it in your cgi-bin and say:
Code:
<!--#exec cgi="/cgi-bin/chat.cgi" -->
Alternatively, since the file in question is in your web-accessible space, use a URL instead of an absolute file location:
Code:
<!--#include virtual="/chat.cgi" -->
(assuming chat.cgi is in your public_html directory, or equivalent).

You can find some useful SSI resources and how-to's at in faq253-3309

-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top