SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Zealot
    Join Date
    Sep 2004
    Location
    Boston
    Posts
    174
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    remote site include - is this even possible?

    Hello All,


    PHP guru, JS novice.


    The boss wants to distribute a mini-site to partners but still maintain control of the site on our end. The initial thought was to just send them a Flash app but I'm not sure if that will be the most practical. Here's what I would like to be able to do. I don't know if it's even possible.

    In this proof-of-concept model the mini site has three pages that all link to each other. Pages also include images and a form. The partner's site would have a bit a javascript on the page to set a unique ID parameter and then load our mini site.

    I imagine this JS site importer would wind up spitting out a bunch of document.write() stuff to basically write our site into the page of the partner's site.

    Am I even making sense?

    The desired effect is to allow the partner's site to display our content within their shell. AND for us to be able to change the content at will. AND to be ble to shut off the partner's feed (via that unique ID parameter) if we need to.

    I'm not asking for a complete pre-written solution (although it wouldn't be rejected!) Just for a shove in the right direction.

    Thanks in advance,
    --Mark

  2. #2
    SitePoint Guru
    Join Date
    Apr 2006
    Posts
    802
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    For this, you better use php curl, javascript isn't going to cross domains

  3. #3
    SitePoint Zealot
    Join Date
    Sep 2004
    Location
    Boston
    Posts
    174
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I don't think php curl isn't going to do it for me. I was hoping for a solution that looked somthing like this

    Code:
    <script language="javascript" type="text/javascript">
    <!--
    var unique_key = "big long secret string";
    // -->
    </script>
    <script langauge ="javascript" src="mydomain.com/partnersite.js">
    displayminisite();
    </script>
    The displayminisite() function does all the work of retrieving the html of the mini site based on the unique_key setting and then writing that html to the page so it gets displayed by the users browser.

    In the above example the js code is on the partner's site; and mydomain.com refers to my site.

  4. #4
    SitePoint Enthusiast
    Join Date
    Feb 2004
    Location
    Third Stone From The Sun
    Posts
    82
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    In JSTL it is easy.
    Code:
    <c:import url="http://www.example.com"/>
    Search for this functionality in PHP.

    Research the curl feature that mrhoo suggested.

    Garrett
    My outdated site is down for a while now.


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
  •