I am making rss feed
using php
and mysql
.
I pulled publications from database and formatted feed data as follows:
$output = "<?xml version='1.0' encoding='UTF-8'?>
<rss version='2.0' encoding='UTF-8'>
<channel>
<title>Our CareFusion Publications RSS "</title>
<link>http://www.dev.carefusion.co.uk/news/rss.php</link>
<description>This is the testing publication rss feeds</description>
<language>en-us</language>
<pubDate>{$now}</pubDate>
<webMaster>Ghazanfar Mir</webMaster>
";
Then looping through each publication:
foreach($getPublications as $publication)
{
$output .= "<item><title>{$publication['Publication_title']}</title>
<link>http://www.dev.carefusion.co.uk/news/rss.php</link>
<description>" . strip_tags($publication['Publication_summary']) . "</description>
<pubDate>" . date( "D, d M Y H:i:s T", $publication['pubdate']) . "</pubDate>
</item>";
}
$output .= "</channel></rss>";
header("Content-Type: application/rss+xml; charset=ISO-8859-1");
echo $output;
QUESTIONS:
rss
is showing only 4, WHY?
I checked source code of the page it shows all 8 items but displays only 4 on browser.Firefox
but not on IE/Chrome
, Why?You've got the encoding declared on the <rss>
tag, which is not a part of the specification. This is the only reason I can currently see as to why the feeds are not showing up on IE/Chrome.
Can you provide the exact source of what's rendered to the browser? The is something else that could possibly be stoping it from rendering on IE or Chrome and why no more than 4 entries appear in Firefox; if the XML has an illegal character (such as &
, <
, or >
), that would cause the browser to stop rendering it completely.