PDA

View Full Version : Dynamic SSI


ptah
08-22-2006, 02:35 PM
Hi all,
I am trying to reduce the amount of code on my site pages by using server side includes for the common parts of the web pages. the problem is, although these files reside on server, they will be used across multiple sites. I read an article (http://www.asp101.com/articles/michael/dynamicincludes/default.asp) explaining that the way around using a tag like
<!--#include file=<%=MyFile%>-->
(where MyFile = "http://www.siteone.com/common/commonFile.asp)

is replaced by a function that reads the contents of the file to be imported.

problem is, mapPath(urlString) works if urlString is not an absolute path. my question is, how do i get to include the contents of a file - sampleFile.asp on website www.siteone.com - in to www.sitetwo.com?

all help will be highly appreciated.

peter.

Spudhead
08-22-2006, 05:34 PM
Hmm. Are these sites on physically seperate machines?

You could use XMLHTTP to get the file contents, although that would only get the generated output of any ASP-based includes, not include the ASP code per se.

daninmanchester
08-27-2006, 06:16 PM
depending on your infrastructure you could set up a virtual folder on IIS that points to the other server. This would allow you to include the file in the traditional way.