Forums
This topic is locked
Including content from another site
Posted 08 Apr 2004 17:11:32
1
has voted
08 Apr 2004 17:11:32 Marc McHale posted:
I need to be able to include content from one of my websites, in another site. The two sites are on different servers.The server that will hold the content is running a content management system that productes friendly urls.
Are IFrames the way forward? or is there a different solution?
Is there an extension for dmx2004?
Thanks for your time
Marc McHale
Vanguardia Web Solutions
Replies
Replied 09 Apr 2004 01:16:35
09 Apr 2004 01:16:35 Phil Shevlin replied:
Are you wanting to include just the text content (from the database on the other server) or actual full web pages?
Replied 11 Apr 2004 17:38:15
11 Apr 2004 17:38:15 Rene Bandsma replied:
I think that marcmchale wants to include a code from an external URL.
Something like this:
<pre id=code><font face=courier size=2 id=code><!-- #include virtual="URL=www.domain.com/dir/file.html" -->
</font id=code></pre id=code>
But include works only for internal files, and then you have to use objXmlHttp object.
Some code:
<pre id=code><font face=courier size=2 id=code><%
Dim objXmlHttp
Dim strHTML
Set objXmlHttp = Server.CreateObject("Msxml2.ServerXMLHTTP"
objXmlHttp.open "GET", "www.domain.com/dir/file.asp", False
objXmlHttp.send
Response.Write "Status: " & objXmlHttp.status & " " _& objXmlHttp.statusText & "<br />"
strHTML = objXmlHttp.responseText
Set objXmlHttp = Nothing
%>
<h1>Here's The Page:</h1>
<table border="1" bgcolor="#FFFFFF">
<tr><td>
<%= strHTML %>
</td></tr>
</table>
<br />
<h1>Here's The Code:</h1>
<table border="1" bgcolor="#FFFFFF">
<tr><td>
<pre>
<%= Server.HTMLEncode(strHTML) %>
</pre>
</td></tr>
</table> </font id=code></pre id=code>
Something like this:
<pre id=code><font face=courier size=2 id=code><!-- #include virtual="URL=www.domain.com/dir/file.html" -->
</font id=code></pre id=code>
But include works only for internal files, and then you have to use objXmlHttp object.
Some code:
<pre id=code><font face=courier size=2 id=code><%
Dim objXmlHttp
Dim strHTML
Set objXmlHttp = Server.CreateObject("Msxml2.ServerXMLHTTP"
objXmlHttp.open "GET", "www.domain.com/dir/file.asp", False
objXmlHttp.send
Response.Write "Status: " & objXmlHttp.status & " " _& objXmlHttp.statusText & "<br />"
strHTML = objXmlHttp.responseText
Set objXmlHttp = Nothing
%>
<h1>Here's The Page:</h1>
<table border="1" bgcolor="#FFFFFF">
<tr><td>
<%= strHTML %>
</td></tr>
</table>
<br />
<h1>Here's The Code:</h1>
<table border="1" bgcolor="#FFFFFF">
<tr><td>
<pre>
<%= Server.HTMLEncode(strHTML) %>
</pre>
</td></tr>
</table> </font id=code></pre id=code>