Reply to Magpie RSS Rejects PHP generated RSS Feed

Your name:

Reply:


Posted by Steve on 04/11/07 20:26

Can any see why Magpie RSS won't accept this RSS Feed (that is valid
according to the Feed Validator website).

http://www.westyorksprobation.org.uk/rss.php?type=Library

This is the code that generates it. A SQL query is run first into
$result and then:

if (mysql_num_rows($result)>0)
{
header("Content-Type: application/xml; charset=ISO-8859-1");
echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>\r\n";
echo " <rss version=\"2.0\">\r\n";
echo "\r\n";
echo " <channel>\r\n";
echo " <title>" . htmlspecialchars($title) . "</title>\r\n";
echo " <link>".htmlspecialchars("http://
www.westyorksprobation.org.uk/")."</link>\r\n";
echo " <description>RSS Feed for the " . htmlspecialchars($title) .
"</description>\r\n";
echo " <language>en-gb</language>\r\n";
echo " <lastBuildDate>" . date("D, d M Y H:i:s O",time()) . "</
lastBuildDate>\r\n";
echo " <ttl>60</ttl>\r\n";
echo " <copyright>Copyright " . date("Y",time()) . " West Yorkshire
Probation Board</copyright>\r\n";

while($resultsrow=mysql_fetch_row($result))
{
echo " <item>\r\n";
echo " <title>" . htmlspecialchars($resultsrow[0]) . "</title>\r
\n";
echo " <description>" .
htmlspecialchars(strip_tags(substr($resultsrow[1],0,500))) . "...</
description>\r\n";
echo " <link>";
echo htmlspecialchars("http://www.westyorksprobation.org.uk/
library.php?action=accsearch&string=".$resultsrow[3]);
echo" </link>\r\n";
echo " <guid isPermaLink=\"true\">";

echo htmlspecialchars("http://www.westyorksprobation.org.uk/
library.php?action=accsearch&string=".$resultsrow[3]);

echo" </guid>\r\n";

echo " <pubDate>" . date("D, d M Y H:i:s
O",strtotime($resultsrow[2])) . "</pubDate>\r\n";
echo " </item>\r\n";
echo "\r\n";
}
echo " </channel>\r\n";
echo " </rss>\r\n";
}
include("includes/disconnect.php");
exit;

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация