Welcome to WebmasterWorld Guest from 184.73.3.107

Forum Moderators: ocean10000

Can you include a file from a different server (ie Domain)?

   
10:14 pm on Mar 2, 2004 (gmt 0)

10+ Year Member



I am trying to utilize files from a different server (domain1) on a new site (domain2). Can you use these files as includes from one server to another? Like:
<!--#include file = "http://www.domain1.com/includes/somefile.asp"-->

I know what the obvious solution would be and that is to copy the files from one server to the other and use from there, but there is a method to my madness and would prefer to leave them on the original server.

Thanks for your help!
Kristib

10:24 pm on Mar 2, 2004 (gmt 0)

10+ Year Member



AFAIK that's not possible
10:25 pm on Mar 2, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can try an ASP component like ASPtear (free, I believe)
2:33 am on Mar 3, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Do a search on google for "xmlhttp"

It should do the trick for you.

12:20 pm on Mar 3, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Re asptear/xmlhttp

Can page scraping actually include asp code to execute? I though it just captured the page content as string.

If it was possible it would be very worrying...

3:55 pm on Mar 3, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can only fetch the rendered output, not the ASP code.
5:48 pm on Mar 3, 2004 (gmt 0)

10+ Year Member



MrSpeed is correct, it will only get the rendered page output, not the actual code. Using xmlhttp is pretty neat especially if used within an application to get another page output from a different directory. Heck, you can even have all your variables in a single xml file and pull the variables that you want to be used in the page.

Mac

10:37 pm on Mar 3, 2004 (gmt 0)

10+ Year Member



You can do it, using both XMLHTTP and the VBscript Execute statement. I wouldn't recommend it though as it creates substantial security risks.

A few links to get you started:
[4guysfromrolla.com ]
[msdn.microsoft.com ]
[4guysfromrolla.com ]

Also, for security, maybe do a hash or something similar on the code to ensure that when you receive the file it's the same as when it was sent.

Regards,
Eric

3:00 am on Mar 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



ebouwsema-
Do you mean you can execute ASP code remotely with the VBscript Execute statement? From what I understood in the articles you can simulate server.transfer and execute on the same machine.
3:39 am on Mar 4, 2004 (gmt 0)

10+ Year Member



Mr. Speed,

The flow would work as follows:

  • Use the XMLHTTP object to retrieve the code from the remote server
  • Store the code in a string variable on the local server
  • Run the code from the string variable using the VBScript Execute statement, similar to as specified in the article above

    Note: the code on the remote server would have to use an extension other than ".asp" if the server is running IIS and it is setup to process the ASP files before outputting.

    Again I'd be quite concerned in regards to the security of using this method, the files would be easy to alter in transmission.

    I hope this answers your question.

    Eric

  •  

    Featured Threads

    Hot Threads This Week

    Hot Threads This Month