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

Problem with Server Side Includes in shtml page 1

Status
Not open for further replies.

gus121

Technical User
May 9, 2002
298
GB
Hi I have the following SSI in webpage.

<!--#include file=&quot;../inc/top_header.inc&quot; -->
<!--#include file=&quot;../inc/left_navi.inc&quot; -->

works fine locally on IIS however when transfer over to ISP host (i think its unix) I recieve error in browser and no include is added. [an error occurred while processing this directive]. Only has a problem when the Server Side Includes path goes down a directory to recieve a file.

thanks

Angus

Angus
 
Unix is case sensitive, make sure your include directives match the file paths letter for letter top_header != Top_Header as far as Unix is concerned.
 
Hi Wullie thanks for your help. I take it 'path relative to the server root' will go somethong like this.

e.g localy:
http:\\localhost\application_name\folder


Angus
 
Errr... no. The server root is the directory that you get served if only the domain name is entered (included files have to be in the web space to work like this). So if the URL of the file to be included is


your SSI command would be
[tt]
<!--#include virtual=&quot;/inc/header.txt&quot; -->
[/tt]

-- Chris Hunt
 
Hi Chris thanks for your swift reply I still can't seem to get the virtual path to work in IIS (which I am using to develop the website). I get object not found. include files are all within the webspace.

<!--#include virtual=&quot;/inc/footer.inc&quot;-->

any ideas why?

Angus
 
This could be to do with an issue I have had with all site relative links in my webpage. To create site relative links in the html i had to resort to puting a html base tag with the path to the root of the web server. If you could help me on this I would be most appreciated.

thanks

Angus

Angus
 
I tried uploading live to (unix) server as well with similar result.


the include file are held in the site root /inc/file.inc

<!--#include virtual=&quot;/inc/footer.inc&quot; -->

thanks for your time. I will ask the IIS forum.

Angus
 
both include files just contain plain html!

the first 1 contains:-
<table width=&quot;100%&quot; border=&quot;0&quot; cellpadding=&quot;0&quot; cellspacing=&quot;0&quot;>
<tr>
<td width=&quot;27&quot;> <img src=&quot;images/Navigation/top_banner_01.gif&quot; width=27 height=42 alt=&quot;&quot;></td>
<td bgcolor=#617F99 width=&quot;54&quot;> <img src=&quot;images/Navigation/spacer.gif&quot; width=54 height=42 alt=&quot;&quot;></td>
<td width=&quot;100%&quot; bgcolor=&quot;#617F99&quot;>&nbsp;</td>
</tr>
</table>

the secound 1 contains:-

<table summary=&quot;TDCi Left Navigation Bar&quot; width=&quot;100%&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot;>
<tr>
<td width=&quot;8%&quot;>
<table summary=&quot;TDCi Products&quot; width=78 border=0 cellpadding=0 cellspacing=0>
<tr>
<td colspan=&quot;2&quot;> <img src=&quot;images/Navigation/spacer2.gif&quot; width=67 height=10 alt=&quot;&quot;></td>
</tr>
<tr>
<td colspan=&quot;2&quot;>
<div align=&quot;center&quot;><img src=&quot;images/Navigation/tdci-solutions.gif&quot; width=&quot;67&quot; height=&quot;49&quot;></div>
</td>
</tr>
<tr>
<td colspan=&quot;2&quot;> <img src=&quot;images/Navigation/spacer2.gif&quot; width=67 height=10 alt=&quot;&quot;></td>
</tr>
<tr>
<td height=&quot;14&quot;width=&quot;61&quot; bgcolor=&quot;#617F99&quot;></td>
<td height=&quot;14&quot; width=&quot;17&quot; bgcolor=&quot;#617F99&quot;><img src=&quot;images/Navigation/prod_cor1.gif&quot; width=&quot;17&quot; height=&quot;14&quot;></td>
</tr>
<tr>
<td class=&quot;left-link-top&quot; bgcolor=&quot;#617F99&quot; colspan=&quot;2&quot;>
<div align=&quot;center&quot;><b>Products </b></div>
</td>
<tr>
<td class=&quot;left-link&quot; bgcolor=&quot;#617F99&quot; colspan=&quot;2&quot;><a href=&quot;Engineering-Solutions/PrescientQA.shtml&quot;>PrescientQA</a>
</td>
</tr>
<tr>
<td class=&quot;left-link&quot; bgcolor=&quot;#617F99&quot; colspan=&quot;2&quot;><a href=&quot;Business-Solutions/Legato.shtml&quot;>Legato</a></td>
</tr>
<tr>
<td class=&quot;left-link&quot; bgcolor=&quot;#617F99&quot; colspan=&quot;2&quot;><a href=&quot;Engineering-Solutions/Enovia.shtml&quot;>Enovia</a></td>
</tr>
<tr>
<td class=&quot;left-link&quot; bgcolor=&quot;#617F99&quot; colspan=&quot;2&quot;><a href=&quot;Engineering-Solutions/Spicer.shtml&quot;>Spicer</a></td>
</tr>
<tr>
<td class=&quot;left-link&quot; bgcolor=&quot;#617F99&quot; colspan=&quot;2&quot;><a href=&quot;Business-Solutions/Worktiviti.shtml&quot;>Worktiviti</a></td>
</tr>
<tr>
<td class=&quot;left-link&quot; bgcolor=&quot;#617F99&quot; colspan=&quot;2&quot;><a href=&quot;Custom-Solutions/Oracle.shtml&quot;>Oracle</a></td>
</tr>
<tr>
<td class=&quot;left-link&quot; bgcolor=&quot;#617F99&quot; colspan=&quot;2&quot;><a href=&quot;Support-solutions/Bakbone.shtml&quot;>Bakbone</a></td>
</tr>
<tr>
<td height=&quot;750&quot; bgcolor=&quot;#617F99&quot; colspan=&quot;2&quot;>&nbsp;</td>
</tr>
</table>
</td>

Angus
 
Are your paths correct?

Can you post the page you are using (With the include statements in it) and also tell us the actual path from the root of your website to where the files to be included are?

Hope this helps

Wullie


The pessimist complains about the wind. The optimist expects it to change.
The leader adjusts the sails. - John Maxwell
 
No problem Wullie.

1)The path from the root of the web site too these two imclude files is as follows:-

/inc/top_header.inc
/inc/left_navi.inc

2) the web page including SSI information can be seen by going to the following and viewing the source.


Thanks for all your help.


Angus
 
sorry I forgot HTML absolute paths were set up to my local network. have changed them to external live site now. sorry. Problem still persists.

Angus
 
Hi mate,

Change your includes to point to:

/newsite/inc/top_header.inc

The files you are referencing do not exist at the paths you are using, the path is /newsite/inc/ not just /inc/

Hope this helps

Wullie


The pessimist complains about the wind. The optimist expects it to change.
The leader adjusts the sails. - John Maxwell
 
Thanks Wullie Idiot not to notice that.

Angus
 
Hi mate,

Easiest way to debug this if you are not sure of paths is to take the domain name, then add the path to the include after it.

I did it with yours and got a 404 error, but when I added /newsite/ before it I got the include. [wink]

Wullie


The pessimist complains about the wind. The optimist expects it to change.
The leader adjusts the sails. - John Maxwell
 
may be its a patch for a website vunerablity that may not let you back reference as it sees the ../ as a type of vunerablity.(you never know)

I would also check to make sure you can even use includes on your ISPs server

on error goto hell
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top