Current location: Hot Scripts Forums » Programming Languages » ASP » Is there a way to include files from other sites?


Is there a way to include files from other sites?

Reply
  #1 (permalink)  
Old 12-08-05, 03:30 PM
swaze swaze is offline
Newbie Coder
 
Join Date: Nov 2005
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
Is there a way to include files from other sites?

I'm new to asp and i have a question!

I want to include a page on my website, but it is not on my server. Can i use <!--#include file="http://www.filename.com/"-->

If not, is there another way?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #2 (permalink)  
Old 12-08-05, 03:59 PM
digioz's Avatar
digioz digioz is offline
Community VIP
 
Join Date: Oct 2003
Location: Chicago, IL
Posts: 2,167
Thanks: 3
Thanked 8 Times in 8 Posts
Hello swaze,

Here is how you can include the Remote HTML page on your site:

Code:
<%
  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://www.digioz.com/", False
 
  ' Actually Sends the request and returns the data:
  xml.Send
  Response.Write "</xmp>"
  Response.Write xml.responseText
  Set xml = Nothing
%>
__________________
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #3 (permalink)  
Old 12-08-05, 04:04 PM
digioz's Avatar
digioz digioz is offline
Community VIP
 
Join Date: Oct 2003
Location: Chicago, IL
Posts: 2,167
Thanks: 3
Thanked 8 Times in 8 Posts
Oh, I should also say that if you don't want to display the HTML browser output (if you just want to show the source code for example, you can use this:

Code:
<%
  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://www.digioz.com", False
 
  ' Actually Sends the request and returns the data:
  xml.Send
  'Display the HTML
  Response.Write "<xmp>"
  Response.Write xml.responseText
  
  Set xml = Nothing
%>
__________________
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #4 (permalink)  
Old 12-02-09, 12:40 PM
biorens biorens is offline
New Member
 
Join Date: Dec 2009
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
OK it can return results BUT it can execute asp code in the opened file. Someone can help?

Hi
my problem in fact is other:
I'm trying to execute a function that is defined in other page and server. My server doesn't allow me to use the FileSystemObject object and I have to send the requests to this server. I really don't need to have a response, only call this function and execute it in its server.
Now i'm trying it with this include
<!--#include virtual="http://ligueando.brinkster.net/funcioncopiafoto.asp"-->
but it doesn't work.
I tried to do it with the xml solution but of course it can't execute asp code.
I tried too to call this page and pass the parameters that function needs by the querystring but I don't know how call a javascript function that opens the page on the other server.
I tried to find an asp instruction to open another asp file (the one in the other server) but nothing...

Some idea? Thanks a lot.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
  #5 (permalink)  
Old 12-30-09, 11:06 PM
Dwagar's Avatar
Dwagar Dwagar is offline
Newbie Coder
 
Join Date: Sep 2008
Location: Ohio
Posts: 35
Thanks: 0
Thanked 0 Times in 0 Posts
That can't be done with an include file or virtual. I remember trying is in the old ASP does before.

If the FileSystemObject is good on a remote location and you don't need a response, you can just do a http post to the page or load the asp page in a hidden iframe that is triggered with javascript.
__________________
SepCity Portal Solutions
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiShare on FacebookShare on Stumble UponShare on Twitter
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Six Sites Exchanging Links! - PR3+ Web Hosting, Web Design, Entertainment & Career coffeecoder General Advertisements 0 10-10-05 01:52 AM
PHP help... Orchidsdance PHP 8 09-25-04 08:58 PM
Link exchange offer – 5 sites. program-ace Traffic Exchange 0 09-05-04 07:58 AM
Run of Site link exchange with webmaster sites Philarmon Traffic Exchange 0 05-07-04 02:43 PM
netadmin project - delete files georgeminton Visual Basic 0 03-03-04 05:03 PM


All times are GMT -5. The time now is 08:58 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.