By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,984 Members | 2,832 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,984 IT Pros & Developers. It's quick & easy.

asp include files from different server

P: 1
Does anyone know if you can include files from another server/domain?

ie: <!-- #include file="http://www.someotherdomain.com/file.inc" -->

Thank you
May 26 '06 #1
Share this Question
Share on Google+
2 Replies


Expert Mod 100+
P: 2,327
I don't think that can be done. Code files are interpreted on the local server, so the display would be blank. Not only that; there would definitely be some security issues involved with that.
May 26 '06 #2

P: 1
Does anyone know if you can include files from another server/domain?

ie: <!-- #include file="http://www.someotherdomain.com/file.inc" -->

Thank you

Yes, you have to use XMLHTTP

Something like this..

<%
Response.Buffer = True
Dim objXMLHTTP, xml

' Create an xmlhttp object:
Set xml = Server.CreateObject("Microsoft.XMLHTTP")
' Or, for version 3.0 of XMLHTTP, use:
' Set xml = Server.CreateObject("MSXML2.ServerXMLHTTP")

' Opens the connection to the remote server.
xml.Open "GET", "http://pathToIncludeOnDifferentserver", False

' Actually Sends the request and returns the data:
xml.Send

'Display the HTML
Response.Write xml.responseText


Set xml = Nothing
%>
Dec 18 '06 #3

Post your reply

Sign in to post your reply or Sign up for a free account.