ASP - Include External File

StephaneP
StephaneP used Ask the Experts™
on
Hi,

I have a little problem...
I try to include an ASP file that is not on my Server.

I tried <!--#include file=""--> and Server.Execute but it's not working.

For example, if I want a webpage that have a specific design and in the middle of this page, I want to include the main page of Expert-Exchange, how can I proceed?

Another question linked to this one...

I know a Website that give informations about products, and I have the reference of this product, which appear on this Website as a ASP file with a table and informations in it. Is it possible to parse this file to recover all the information contained in it?

I want to use it to get data From another Website but not with the same layout and not all the informations contained in it. To I have to have an DB Access on the Website's database or is there another way to do it?

Thanks a lot,

Stéphane.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Top Expert 2013

Commented:
If you incorporate someone else's page into your own page without permission, that is theft.  It is one thing to to load an external page in a frame without permisssion, but trying to steal content and include it in your own page is beyond any sort of acceptable ethical behaviour.  Do you not have any respect for the rights of of web site owners?

If you want someone's page ask for permission to downlaod it to your site.  

Cd&

Commented:
:-)

IF you have permission or display the full copyright of the user there are ways of doing this using HTTP calls to the various urls.

CJ

Commented:
>>I try to include an ASP file that is not on my Server.

This is not possible unless you can map a network share as a drive on your server. If you can't do that, you can't use the file.

IOW, if it ain't yours, you can't use it. ;-)
C++ 11 Fundamentals

This course will introduce you to C++ 11 and teach you about syntax fundamentals.

Author

Commented:
Thanks for the answers.
I don't want to use page I don't have permission to use! I respect intellectual property far more than copyright...;)

I'm a Web Developper, so I have a ethic sense about other work because I can understand as much as any other developper this feeling! ;)

The problem is that I don't want to download file, I want an automatic display incorporatedin my web page with a little layout change, or maybe a parsing of this file to retrieve the informations and handle it!

Stephane.

Commented:
Then put it on your servers. If it's not on your server, you can't use it. For good reason -- if YOU could, so could anybody else who decided they liked/wanted it.
Commented:
Hi Stephane,

I hope this helps and I am posting this comment for educational purposes only.. I am not encouraging "getting"
 other people's site without permission..



one way to do this is using the microsoft's xmlhttp object. the most basic function of this object is to return the entire text of another web page.

Let me know if this is what you want. Thanks.




<%
  Response.Buffer = True
  Dim objXMLHTTP, xml

  ' instantiate the XMLHTTP OBJECT :
  Set objXML = Server.CreateObject("Microsoft.XMLHTTP")
 
 'or you can use
  ' Set objXML = Server.CreateObject("MSXML2.ServerXMLHTTP")

  ' open a connection to a remote website.
  objXML.Open "GET", "http://www.abcdefghijklmnop.com", False
     
  ' sends the request and returns the data:
  objXML.Send

  'Display the HTML both as HTML and as text
  Response.Write "<h1>HTML TEXT</h1><xmp>"
  Response.Write objXML.responseText
  Response.Write "</xmp><p><hr><p><h1>HTML PAGE</h1>"

  Response.Write objXML.responseText
 
 
  Set objXML = Nothing
%>


GOOD LUCK!

Author

Commented:
Thanks for your answer, I thought of a solution like this!

Be assure that I will not use this method to "steal" other people work.

Stéphane.
This is also very useful for other legitmate reasons.

Namely as a webmaster I have written several sites that I still maintain.  I am now using this to get external page counters for my own personal statistics to see which sites do well and which don't :)

Cheers.

Chris Farrell

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial