472,093 Members | 2,517 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,093 software developers and data experts.

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 6315
Niheel
2,452 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
reply views Thread by leo001 | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.