/    Sign up×
Community /Pin to ProfileBookmark

Include content from another website

I’ve got a project where my clients will need to integrate a product catalog, which pulls its data from a database, from my site into their site. Here are some ideas I have thus far:

  • 1. The client adds this simple code to their site to import the exact layout of my catalog. This is for a client who knows little about websites and may want to do it themselves:
  • <?php
    $content = file_get_contents(“http://www.mysite.com/catalog.php“);
    echo $content;
    ?>

  • 2. I provide a SOAP server that will send them the catalog data as XML, and it’s up to them how they want to layout the catalog:
  • Can anyone else think of better solutions to this? I also need it to be compatible with other servers, so solution #1 will need the code for ASP and such.

    Thank you.

    to post a comment
    PHP

    1 Comments(s)

    Copy linkTweet thisAlerts:
    @PETTEJul 20.2009 — Using '$content = file_get_contents("http://www.mysite.com/catalog.php");' I think is not such a good idea. Since they might consider changing or redesigning the layout in future.

    Providing only the data is best and letting the decoration take place on there website. Also the http://www.mysite.com/catalog.php might change which could cause problems for the website accessing it.

    Using SOAP or XML is the best option here. Perhaps making the http://www.mysite.com/catalog.php produce an xml file when called. Reasons being it's only data which can be used in any way by your client. Another way might be providing the full info for your server host such as hostname, username... that is if he's a trust worthy client.
    ×

    Success!

    Help @KnightDeveloper spread the word by sharing this article on Twitter...

    Tweet This
    Sign in
    Forgot password?
    Sign in with TwitchSign in with GithubCreate Account
    about: ({
    version: 0.1.9 BETA 5.17,
    whats_new: community page,
    up_next: more Davinci•003 tasks,
    coming_soon: events calendar,
    social: @webDeveloperHQ
    });

    legal: ({
    terms: of use,
    privacy: policy
    });
    changelog: (
    version: 0.1.9,
    notes: added community page

    version: 0.1.8,
    notes: added Davinci•003

    version: 0.1.7,
    notes: upvote answers to bounties

    version: 0.1.6,
    notes: article editor refresh
    )...
    recent_tips: (
    tipper: @AriseFacilitySolutions09,
    tipped: article
    amount: 1000 SATS,

    tipper: @Yussuf4331,
    tipped: article
    amount: 1000 SATS,

    tipper: @darkwebsites540,
    tipped: article
    amount: 10 SATS,
    )...