PDA

View Full Version : My SSI doesn't work on futurequest!!!


jonni
09-03-2008, 10:35 AM
I run Apache2.x and Mozilla on my own system for developing simple websites for guesthouses/businesses in the west of ireland. SSI is a great tool for diminishing workload and organising web-pages logically. The following is an example of what I have written and tested sucessfully on my own system

body of home.shtml
<body class="bg">
<center>
<!--#set var="page" value="home" -->
<!--#include virtual="common/main.shtml" --><br>
</center>
</body>

file common/main.shtml
<!--main 3(rows)x3(columns) table-->
<table class="general" border="2" align="center" width="96%" bgcolor="#0000ff">
<tr align="center">
<td width="200"><img src="gallery/mg_logo.jpg" width="200" height="150" border="0">
</td>
<td colspan="2">
<!--2x4 navigational table-->

<table class="general" border="2" align="center" width="96%">
<tr align="center">
<!--#if expr="$page = home" -->
<!--#include virtual="../home/nav.html" -->
<!--#elif expr="$page = directions" -->
<!--#include virtual="../directions/nav.html" -->
<!--#elif expr="$page = see_do" -->
<!--#include virtual="../seeanddo/nav.html" -->
<!--#elif expr="$page = booking" -->
<!--#include virtual="../bookingform/nav.html" -->
<!--#elif expr="$page = thankyou" -->
<!--#include virtual="../bookingform/nav.html" -->
<!--#endif-->
</tr>
<tr align="center">
<td><a class="nav" href="home.shtml">Home</a></td>
<td><a class="nav" href="directions.shtml">Directions</a></td>
<td><a class="nav" href="see_do.shtml">See and Do</a></td>
<td><a class="nav" href="booking.shtml">Booking Form</a></td>
</tr>
</table>
<!--end of 2x4 navigational table-->
</td>
</tr>

file ../home/nav.html

<!--navigation at home-->
<td><img src="gallery/button_1active.gif" width="150" height="100" border="0"></td>
<td><img src="gallery/button_2.gif" width="150" height="100" border="0"></td>
<td><img src="gallery/button_3.gif" width="150" height="100" border="0"></td>
<td><img src="gallery/button_4.gif" width="150" height="100" border="0"></td>
<!--end of navigation at home-->

as I said it all works fine on my own system but after loading it on to futurequest the resulting code in the browser is this

<body class="bg">
<center>
<!--#set var="page" value="home" -->
<!--main 3(rows)x3(columns) table-->
<table class="general" border="2" align="center" width="96%" bgcolor="#0000ff">
<tr align="center">
<td width="200"><img src="gallery/mg_logo.jpg" width="200" height="150" border="0">
</td>
<td colspan="2">
<!--2x4 navigational table-->

<table class="general" border="2" align="center" width="96%">
<tr align="center">
<!--navigation at home-->
<td><img src="gallery/button_1active.gif" width="150" height="100" border="0"></td>
<td><img src="gallery/button_2.gif" width="150" height="100" border="0"></td>
<td><img src="gallery/button_3.gif" width="150" height="100" border="0"></td>
<td><img src="gallery/button_4.gif" width="150" height="100" border="0"></td>
<!--end of navigation at home-->

something like that, in other words it doesn't recognise if,elif, endif it doesn't parse beyond nested includes, all in all its a total waste of time, maybe I'm missing something small, anyone???

Terra
09-03-2008, 10:53 AM
You are most likely running into the differences between Apache 2.x and Apache 1.x SSI processing...

Please view:
http://httpd.apache.org/docs/1.3/howto/ssi.html

and adjust your code accordingly...

As an alternative, you can gain similar functionality by switching these pages to PHP...

Terra
09-03-2008, 10:55 AM
Also, SSI is sensitive to embedded CRLF... Double check your SSI pages and ensure they have been uploaded in ASCII mode...

jonni
09-09-2008, 08:25 AM
hi terra,
I tried a couple of things, uploading in ascii seems to have had a positive effect and also writing <--#endif --> instead of <--#endif--> was the key to the coding differences between apache 1.3x and apache 2x
hope this is of help to anyone else,
j-)