SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    My precious!!! astericks's Avatar
    Join Date
    Mar 2002
    Location
    Vancouver, BC
    Posts
    1,971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Offsite server includes

    Hi guys,

    From server X, I'm trying to include a file that reside on server Y.

    i.e include_me.htm is on one server

    and mainfile.asp is on another server.

    In mainfile.asp, I have the following:
    <!--#include file="http://www.my_other_server.com/include_me.htm"-->
    and I'm getting this error:
    Active Server Pages
    error 'ASP 0126'

    Include file not found


    And I'm 110% sure the file exists.


    any help is appreciated


    cheers
    asT.

  2. #2
    SitePoint Wizard
    Join Date
    Nov 2004
    Location
    Nelson BC
    Posts
    2,310
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    You can't include a file that's on another server.

  3. #3
    My precious!!! astericks's Avatar
    Join Date
    Mar 2002
    Location
    Vancouver, BC
    Posts
    1,971
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    any ways around that?

    thanks

  4. #4
    SitePoint Wizard
    Join Date
    Nov 2004
    Location
    Nelson BC
    Posts
    2,310
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    <%
    Set oX = Server.CreateObject("MSXML.ServerXMLHTTP")
    oX.open "GET", "http://www.my_other_server.com/include_me.htm", false
    oX.send
    
    sHTML = ""
    If oX.status <> 200 Then
      'error
    Else
      sHTML = oX.responseText
    End If
    
    Response.Write sHTML ' <-- this contains the HTML from the loaded file as a string
    %>


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •