Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Old 08-23-2008, 07:11 AM RSS problem
Super Talker

Posts: 104
Location: Northern Ireland
Trades: 0
Ok

I have built my little XML page to show content on my website from someones RSS feed.

http://www.paranormal-search.com/paranormal-news.xml

Why do I have to click a link to see the feed? Surely the feed should just be displayed under where it says Paranormal News?

Can someone tell me what code i need to insert?

Confused

Thanks.
sebastianx is offline
Reply With Quote
View Public Profile Visit sebastianx's homepage!
 
 
Register now for full access!
Old 08-23-2008, 08:32 AM Re: RSS problem
bas
Super Talker

Posts: 108
Name: Bas
Trades: 0
On paranormal-news.xml you show a link to an RSS-feed... it's quit normal that you need to click before you go to that page.
Code:
<?xml version="1.0" encoding="UTF-8" ?> <rss version="2.0"> 
<channel> 		
<title>Paranormal News</title> 		
<link>http://thebeyond.info/</link> 		
<description>The latest Paranormal News, pictures, videos and stories</description> 		
<item>         	
<title>Paranormal News</title>         
<link>http://thebeyond.info/articles/?feed=rss2</link>
</item></channel> 
</rss>
You post this question in the PHP-form, so I conclude you generate paranormal-news.xml with PHP. In that case you should copy all the items of the second page and show it inside of yours... it can't be don (or at least I don't know how to do it) with only a link.

Last edited by bas; 08-23-2008 at 08:34 AM..
bas is offline
Reply With Quote
View Public Profile
 
Old 08-23-2008, 10:08 AM Re: RSS problem
maxxximus's Avatar
Extreme Talker

Posts: 219
Name: Rob
Location: UK
Trades: 0
If you have PHP 5 you can use simplexml to parse XML into an object.

This can then be echoed and formatted as required.

PHP Code:
$xml simplexml_load_file('http://thebeyond.info/articles/?feed=rss2');
    
foreach (
$xml->channel->item as $item) {
    echo 
"<h1>".utf8_decode($item->title) . "</h1>\n";
    echo 
"<p>".utf8_decode($item->description) . "</p>\n";

maxxximus is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to RSS problem
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.11746 seconds with 12 queries