PDA

View Full Version : How do I display news from rss feed from another site using PHP.


Nzou
Jun 17, 2010, 11:35 AM
I am doing a project in wich I'm developing an auction site. To atract visitors I want to add news on the site. I am trying to include an rss feed from allafrica.com using something lyk this:

Include "http://allafrica.com/.../headlines.xml";

It only displays unformated xml code. How do I make it display properly formated news? I'm using xampp for the server.

Nzou
Jun 18, 2010, 01:42 PM
Is what I'm trying to do even posible in any way. I saw there are those rss reader sites but do they give good formated output for my webpage and how do I use them?

rpray2007
Jun 23, 2010, 01:38 AM
You can do it but not the way you are attempting. Instead, you could use CURL which is a great way to send GET variables. You can't include an XML file within a PHP file - this will result in a syntax error.

Sourcebits
Jul 14, 2010, 06:00 AM
Please see php simple_xml_dom parser in php. If no php experience, you may search for RSS reader in php from web.