Gossamer Forum
Home : General : Perl Programming :

ssi on template.(s)html in cgi-bin

Quote Reply
ssi on template.(s)html in cgi-bin
How can I execute an ssi on an .(s)html file in the cgi-bin? I've tried <!-- exec cgi="..." --> and <!-- include virtual="..." -->, but they don't work. The calls don't execute, rather they appear as text in the source.

Thanks in advance.
Quote Reply
Re: ssi on template.(s)html in cgi-bin In reply to
 
Try using this;

<!--#exec cgi="path/to/cgi.cgi"-->

If your on an NT server I don't think you can use ssi.

perkid
Quote Reply
Re: ssi on template.(s)html in cgi-bin In reply to
Code:
If your on an NT server I don't think you can use ssi.

WRONG ANSWER...You can use SSI by adding the hotfix for HTTP HEADERS that will allow SSI in html pages.

Also, you can use ASP to include executable files and text files in web pages.

Wink

Regards,

------------------
Eliot Lee....
Former Handle: Eliot
* Check Resource Center
* Search Forums
Quote Reply
Re: ssi on template.(s)html in cgi-bin In reply to
Your codes have to have the "#" sign in them like the following:
Code:
<!--#exec cgi="path/to/cgi.cgi"-->

and

<!--#include virtual="path/to/file" -->
----------------
donm


Quote Reply
Re: ssi on template.(s)html in cgi-bin In reply to
I actually did include the # sign. i just forgot to include it inmy original post. Neither exec or include virtual have worked.

Does it matter that the file (template.shtml) from which I'm calling the ssi is located in the cgi-bin? Are ssi's not allowed in the cgi-bin? What could be making this happen?
Quote Reply
Re: ssi on template.(s)html in cgi-bin In reply to
First, check with your ISP and make sure the server can display SSI.

Second, rename your page to an .shtml extention.

Third, place the .shtml page in your web accessible directory - NOT your cgi-bin directory.

Last, use the following:
Code:
<!--#exec cgi="path/to/cgi.cgi"-->
<!--#include virtual="path/to/file" -->
or
<!--#include file="path/to/file" -->

--------------
donm
Quote Reply
Re: ssi on template.(s)html in cgi-bin In reply to
Hi donm

I take it that "path/to/file" is the relative path from where the .shtml file is located?

Should a script that is called via SSI in any way be changed compared to when it is called from via the browsers location field?

I get [an error occurred while processing this directive] for the directive
<!--#include virtual="cgi-bin/test_dbman/count_dbrec.cgi" -->, but when I run count_dbrec.cgi from the browser it works fine.

For testing I also have the directive
<!--#include file="mydir/html/help.html" --> and the helpfile shows up nice, which shows that my server supports SSI. But maybe not for running scripts?
Quote Reply
Re: ssi on template.(s)html in cgi-bin In reply to
Got it.

Just to check that I had the right path and expecting to see the source code I put

Code:
<!--#include file="cgi-bin/test_dbman/count_dbrec.cgi" -->

and PRESTO I got the output of the cgi.
Quote Reply
Re: ssi on template.(s)html in cgi-bin In reply to
Basically, I'd like to know how one call another cgi from a file within the cgi-bin? I'm almost sure that this is possible. i just can't remember how to do it.
Quote Reply
Re: ssi on template.(s)html in cgi-bin In reply to
noguru!

Shit,

I created a new thread when I was going to reply. Please look a the thread "Look at this thread."