Forum Moderators: coopster & phranque

Message Too Old, No Replies

Anyone help an SSI virgin?

-tried everything I can think of but can't get this working.

         

nicebloke

9:02 am on Mar 6, 2001 (gmt 0)

10+ Year Member



Ok - sorry to post this - I have gone through all then normal channels, asked, searched, but I am stuck.

I just got some space that supports SSI -so I've been playing around including virtual files, which has been great and all worked fine.

I found [123webmaster.com...] this, which appears to be a great tutorial on creating a very simple dbase using SSI.

So I have gone along all the instructions, editited everything that needs to be edited, and when I try the code, here:

<!--#set var="which" value="$QUERY_STRING_UNESCAPED" -->
<!--#if expr="$which != ''" -->
<!--#include virtual="/properties/$which" -->
<!--#else -->
<!--#include virtual="/propeties/error.txt" -->
<!--#endif -->

I get an error: Error processing SSI file '/properties/$which'

I even got as far as contacting my webhost who say I should be able to upload a .htaccess file, which I did, but I am stil getting errors.

All the files are in the right places, as far as I know.

Am I doing something glaringly wrong?

Many many thanks for any pointers.

sugarkane

9:20 pm on Mar 6, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



A few of wild guesses: Have you checked that the permissions are set correctly on the files to be included - ie does the webserver have permission to read them?

What are the contents of /properties/$which ?

Are you sure the query string contains a valid filename?

Is the path to /properties correct? You may need the full server path on shared servers eg /home/username/properties or alternatively lose the / at the beginning and just use
<!--#include virtual="properties/$which" -->

I don't know if any of this will help, but it's a few things to check.

nicebloke

9:54 pm on Mar 6, 2001 (gmt 0)

10+ Year Member



thanks for your time sugarkane. It is appreciated.

the contents of /properties/$which ?
are 13 or so html files, called property1.html, property2.html, property3.html

No not sure about the query string at all - what must be included here?

Will check the permissions, and yes it's possibly a shared server will check that too. THANKS AGAIN.

sugarkane

10:16 pm on Mar 6, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The query string is the data passed to a script by a form - or by direct url mangling.

In this case it looks like you'd have to call the page using yourpage.shtml?property1.html

The SSI would then use the part of the URL following the ? as the variable $which and display property1.html

nicebloke

10:58 pm on Mar 6, 2001 (gmt 0)

10+ Year Member



Yup that's exactly what I'm trying to do.

I just tried to change the permissions on yourpage.shtml and I get this:

[yourpage.shtml]
COMMAND:> SITE CHMOD 766 property.shtml
501 SITE option not supported.

tried to change it to group & public write but apparently not having it?

Is this essential?

(On an NT server right now - and they're just about to change to unix in the next few days.)

I am on a shared server too yes I see /e/blah/mysitename.com in my ftp program. Where else should this path be used?

Once again thanks for your help here.

sugarkane

11:13 pm on Mar 6, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



>tried to change it to group & public write but apparently not having it?

You *don't* want to do that! So long as it's world readable (possibly group readable depending on the server setup) you'll be OK. The webserver itself generally has the permission rights of world/public so something along the lines of 604 or 644 will be OK (Unix)

>Where else should this path be used?

It really depends on how your server's been set up... If you're seeing /e/blah/mysitename.com in ftp then it's likely you'll need to use it in any script that uses absolute server paths - that is, any path starting with /

nicebloke

7:31 am on Mar 7, 2001 (gmt 0)

10+ Year Member



Thanks a million sugarkane will try that out. URA *

nicebloke

12:41 pm on Mar 7, 2001 (gmt 0)

10+ Year Member



hmmmmm. well tried evey conceivable version of the correct path and I still get the same error. Error processing SSI file '/properties/$which'

Although, I don't know if this is relevant but my error.txt file is only processed, on screen, just below the error when the paths are /properties/ in mypage.shtml

?????

Any ideas?

sugarkane

1:43 pm on Mar 7, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Try changing /properties/$which to properties/property1.html just to narrow it down - if it works you know it's a problem with your query string.

nicebloke

1:56 pm on Mar 7, 2001 (gmt 0)

10+ Year Member



Ok will try that. Thanks. I may be a while trying this as my kitchen ceiling has started to leak water but cheers!

nicebloke

12:24 pm on Mar 8, 2001 (gmt 0)

10+ Year Member



right - flood sorted!

Now, yes that did work.

Still got the error after it but the propery1.html page was displayed in the page.

Soooo....the query string..what do you think could be wrong?

sugarkane

2:24 pm on Mar 8, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



OK, I've taken a look around and come up with this:

<!--#set var="WHICH" value="${QUERY_STRING_UNESCAPED}" -->
<!--#if expr="$WHICH != ''" -->
<!--#include virtual="/properties/$WHICH" -->
<!--#else -->
<!--#include virtual="/properties/error.txt" -->
<!--#endif -->

2 things: the query string variable is enclosed in {}s, and I've fixed a typo in the second properties (dunno if this was present in your actual code or just on your post)

This works for me. I don't know why the {}s are needed - I'm using apache, wonder if it's a server-type thing? (I've never used SSI TBH)

nicebloke

5:27 pm on Mar 8, 2001 (gmt 0)

10+ Year Member



It didn't work!! must be my server.

Error processing SSI file '/properties/$WHICH'

Can't understand it.

Strange when other single SSI commands work, and we defintley have the paths right...

Thanks for your help. Mmmmm now what I wonder...

sugarkane

6:57 pm on Mar 8, 2001 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



NB - dropped you a sticky