/    Sign up×
Community /Pin to ProfileBookmark

Using php on one domain to call for article content stored on another domain

Rather than have numerous copies of the same article on several websites, I would like to store the content of the articles on one domain and call that content with php from other domains, something like this:

[code]
<?php require_once(“../includes/header.php”); ?>
<?php include(“http://www.othersite.com/library/article-content.txt”); ?>
<?php require_once(“../includes/footer.php”); ?>
[/code]

When I try this, I get:

[quote]

Warning: include() [function.include]: Failed opening ‘http://www.othersite.com/library/article-content.txt‘ for inclusion (include_path=’.:/usr/lib/php:/usr/local/lib/php’) in /home2/othersite/public_html/thissite/library/article-content.php on line 10

[/quote]

Line 10 is

[code]<?php include(“http://www.othersite.com/library/article-content.txt”); ?>[/code]

If this is difficult to accomplish, what about storing the article content in mySql?

to post a comment
PHP

0Be the first to comment 😎

×

Success!

Help @jwgrafflin 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 6.18,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...