4

I'm trying to show contents of two websites in one another , someone suggest me to use RSS reader but my question is :

is there anything else i could try to show the contents , beside using rss !?

i thought i can connect to the database of another website , but that didnt work /

thanks in advance

5
  • Do you have control over both websites? Commented Apr 29, 2010 at 7:46
  • 2
    What kind of content are you talking about exactly? Please make an example of what the content looks like, and how you want to display it on your site. Commented Apr 29, 2010 at 7:46
  • yes, RSS is the best solution. Commented Apr 29, 2010 at 7:48
  • it will likely result in a mess anyway. If have to do that, your design is flawed in the first place. Commented Apr 29, 2010 at 8:18
  • 1
    @Lo'oris content syndication and aggregation is nothing uncommon. Commented Apr 29, 2010 at 8:26

2 Answers 2

5

some of web hosting has disabled "readfile" function. But you can use "file_get_contents" function.

$home = file_get_contents('example.com');
echo $home;
Sign up to request clarification or add additional context in comments.

Comments

2

Any PHP function that can fetch remote URLs can help you with that. This can be as simple as doing

readfile('http://example.com'); // outputs contents of URL

If you need to scrape only some contents of a URL or want to postprocess the content, consider using DOM. In case you are trying to parse a specific XML format like RSS, use a parser specialized for that format. If there is no parser for that format, use XSLT to transform it to HTML.

As for database access, why not ask the owner of the remote site and database if and how you may access it.

Like the comments below your question already suggested, if you can be more specific about the problem, we can be more specific about a solution.

2 Comments

...but do implement some server-side caching!
@symcbean Could you be a little more specific? Give an example, technique name, etc.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.