Get ready for BLACK FRIDAY shopping starting in

Forums

ASP

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>&lt;!-- #include virtual="URL=www.domain.com/dir/file.html" --&gt;
</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>&lt;%
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 & "&lt;br /&gt;"
strHTML = objXmlHttp.responseText
Set objXmlHttp = Nothing
%&gt;

&lt;h1&gt;Here's The Page:&lt;/h1&gt;
&lt;table border="1" bgcolor="#FFFFFF"&gt;
&lt;tr&gt;&lt;td&gt;
&lt;%= strHTML %&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;

&lt;br /&gt;

&lt;h1&gt;Here's The Code:&lt;/h1&gt;
&lt;table border="1" bgcolor="#FFFFFF"&gt;
&lt;tr&gt;&lt;td&gt;
&lt;pre&gt;

&lt;%= Server.HTMLEncode(strHTML) %&gt;
&lt;/pre&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt; </font id=code></pre id=code>

Reply to this topic