www.webdeveloper.com
Results 1 to 7 of 7

Thread: Include file with http.. can I?

  1. #1
    Join Date
    Feb 2004
    Posts
    1,345

    Include file with http.. can I?

    Can I have the address of my include contain http://... the whole URL?

    Thanks!

  2. #2
    Join Date
    Nov 2003
    Location
    SA
    Posts
    261
    I don't know, try it, it probably will work...

  3. #3
    Join Date
    Feb 2004
    Posts
    1,345
    I tried it and it didn't work but I wasn't sure about the syntax.

    Don't get me wrong but does it make sense answer: "I don't know..."?

  4. #4
    Join Date
    Jan 2004
    Location
    Melbourne, Australia
    Posts
    5,298
    As far as I am aware, the included file must be local and preferably relative to the root directory of the Web Site.

    I have not looked into the possibilities of grabbing data from remote servers. Mayby try something via the XML or FSO api's?

    Regards.

  5. #5
    Join Date
    Feb 2003
    Posts
    2,745
    You can't. That would be a huge security hole. PHP allows it though, along with some other really interesting security flaws...can you say "register globals" ...?


  6. #6
    Join Date
    Nov 2003
    Location
    SA
    Posts
    261
    OK... here's a thought... give it a go and it might surprize you:

    Create an asp page that you will use as the include file on your local domain, but it must be an asp page, then put only this code in it:

    Response.Redirect("http://www.whateverdomain.com")

    Let me know if this works, which I'm pretty sure will...

  7. #7
    Join Date
    Nov 2003
    Location
    SA
    Posts
    261
    Oh, here's the code to grab a remote page's source if above doesn't work for you:

    function GetHTML(strURL)
    {
    var objXMLHTTP = Server.CreateObject("Microsoft.XMLHTTP");

    objXMLHTTP.Open("GET", strURL, false);
    objXMLHTTP.Send();

    var strReturn = objXMLHTTP.responseText;
    objXMLHTTP.Close;
    objXMLHTTP.Delete;

    return strReturn;
    }

    Response.Write(GetHTML("http://www.whateverdomain.com"));

    It's done in ASP JScript, just change it to ASP VBScript... it's easy but if you don't know how just ask.

    Good luck

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles