469,942 Members | 2,606 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,942 developers. It's quick & easy.

asp include files from different server

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
2 6158
Niheel
2,442 Expert Mod 2GB
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
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.

Similar topics

11 posts views Thread by Yannick Turgeon | last post: by
6 posts views Thread by JStrummer | last post: by
2 posts views Thread by Marcus | last post: by
5 posts views Thread by David Mathog | last post: by
2 posts views Thread by Bill Roper | last post: by
6 posts views Thread by tshad | last post: by
5 posts views Thread by Viken Karaguesian | last post: by
111 posts views Thread by Nate | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.