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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SSI - can't call code 2

Status
Not open for further replies.

JennyW

Technical User
Mar 1, 2001
323
CA
Hi!

I keep getting this error:
[an error occurred while processing this directive]

I think my ssi call is right. Regardless, here it is:

<!--#include file=&quot;/ssi/ssi_test.txt&quot; -->


The shtml page that calls the ssi is in a folder called z_folder. The file in it is called ssi_testing.shtml


I think the slash in red is the problem:

<!--#include file=&quot;/ssi/ssi_test.txt&quot; -->


When I put my file (that holds the ssi code) in the root directory and delete the slash above, my ssi displays.

Why isn’t my ssi working when the slash / is included in the call?


Here’s my test page (including error message):


Thanks for taking the time to read my ramblings :)
Jenny
 
Try it like this Jenny,

<!--#include file=&quot;../ssi/ssi_test.txt&quot; -->

I hope this helps,

BobbaFet Everyone has a right to my opinion.
E-mail me at caswegkamp@hotmail.com
 
Hi bobba!

Thanks. You and a few others have advised that. It works nicely.

Take care,
Jenny
 
Hi Guys,

Just out of interest the problem with your include was the reference from the root directiry (the / prefix). An alternative to using a relative reference is to use a virtual include like this:

<!--#include virtual=&quot;/ssi/ssi_test.txt&quot; -->

or as it is always a reference from root this would work too

<!--#include virtual=&quot;ssi/ssi_test.txt&quot; -->

though i prefer to keep the forward slash in to remind myself the reference is form root.

hope this helps

rob
 
Hi!

crazyboybert,
Thanks. I found out this morning that my problem was kinda what you described above...

I was using the following call in my shtml pages:

<!--#include file=&quot;include.txt&quot; -->

Supposedly this command only adds ssi files when everything is in the same directory.

Is that correct?

This call however...

<!--#include virtual=&quot;../jennyw/include.txt&quot; -->

...can call ssi from other directories.


I learned this on my hosts website this morning.

Thanks so much!
Jenny :)
 
Yes that is correct.

when you write only the filename down you tell the browser its in the same directory. But when you write it down like
this: &quot;../jennyw/myssi.txt&quot; you tell the browser to first
go to the root of your account then look in the directory
&quot;jennyw&quot; for &quot;&quot;myssi.txt&quot;.

I hope this is clear enough for you,

BobbaFet Everyone has a right to my opinion.
E-mail me at caswegkamp@hotmail.com

Heineken is like making love in a cano... it's f*cking close to water !!!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top