...

View Full Version : PHP Generated RSS Feed



cweagans
07-17-2007, 01:19 AM
Hello,

I wrote a script in PHP that queries my news database and builds an RSS feed from it. Unfortunately, the RSS feed is invalid, according to Mozilla Thunderbird. My RSS feed is as follows:


<?xml version="1.0" encoding="utf-8"?><rss version="2.0"><channel>
<title>Mountain View Player's</title>
<link>http://www.mountainviewplayers.com/rss/rss.xml</link>
<description>The latest news from Mountain View High School's Drama Department</description>
<copyright>(c) 2007, Mountain View Players. All rights reserved.</copyright><item><title>First Official News</title><description>This is the first actual piece of news in the Mountain View Players news archive and it is this: the RSS building code is done. The news reader code is done. Next to be added is a way to view ALL of the news</description><link>http://www.mountainviewplayers.com/index.php</link><pubdate>2007-07-14</pubdate></item><item><title>Test heading 2</title><description>test body 2 test body 2 test body 2 test body 2 test body 2 test body 2 </description><link>http://www.mountainviewplayers.com/index.php</link><pubdate>2007-07-10</pubdate></item><item><title>Test heading 2</title><description>test body 2 test body 2 test body 2 test body 2 test body 2 test body 2 </description><link>http://www.mountainviewplayers.com/index.php</link><pubdate>2007-07-10</pubdate></item><item><title>Test heading 2</title><description>test body 2 test body 2 test body 2 test body 2 test body 2 test body 2 </description><link>http://www.mountainviewplayers.com/index.php</link><pubdate>2007-07-10</pubdate></item><item><title>Test heading 2</title><description>test body 2 test body 2 test body 2 test body 2 test body 2 test body 2 </description><link>http://www.mountainviewplayers.com/index.php</link><pubdate>2007-07-10</pubdate></item><item><title>Test heading 2</title><description>test body 2 test body 2 test body 2 test body 2 test body 2 test body 2 </description><link>http://www.mountainviewplayers.com/index.php</link><pubdate>2007-07-10</pubdate></item><item><title>Test heading 2</title><description>test body 2 test body 2 test body 2 test body 2 test body 2 test body 2 </description><link>http://www.mountainviewplayers.com/index.php</link><pubdate>2007-07-10</pubdate></item><item><title>Test heading 2</title><description>test body 2 test body 2 test body 2 test body 2 test body 2 test body 2 </description><link>http://www.mountainviewplayers.com/index.php</link><pubdate>2007-07-10</pubdate></item><item><title>Test heading 2</title><description>test body 2 test body 2 test body 2 test body 2 test body 2 test body 2 </description><link>http://www.mountainviewplayers.com/index.php</link><pubdate>2007-07-10</pubdate></item><item><title>Test heading 2</title><description>test body 2 test body 2 test body 2 test body 2 test body 2 test body 2 </description><link>http://www.mountainviewplayers.com/index.php</link><pubdate>2007-07-10</pubdate></item><item><title>Test heading 2</title><description>test body 2 test body 2 test body 2 test body 2 test body 2 test body 2 </description><link>http://www.mountainviewplayers.com/index.php</link><pubdate>2007-07-10</pubdate></item></channel></rss>


...And here is the pretty version:



<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Mountain View Player's</title>
<link>http://www.mountainviewplayers.com/rss/rss.xml</link>
<description>The latest news from Mountain View High School's Drama Department</description>
<copyright>(c) 2007, Mountain View Players. All rights reserved.</copyright>
<item>
<title>First Official News</title>
<description>This is the first actual piece of news in the Mountain View Players news archive and it is this: the RSS building code is done. The news reader code is done. Next to be added is a way to view ALL of the news</description>
<link>http://www.mountainviewplayers.com/index.php</link>
<pubdate>2007-07-14</pubdate>
</item>

<item>
<title>Test heading 2</title>
<description>test body 2 test body 2 test body 2 test body 2 test body 2 test body 2 </description>
<link>http://www.mountainviewplayers.com/index.php</link>
<pubdate>2007-07-10</pubdate>
</item>

<item>
<title>Test heading 2</title>
<description>test body 2 test body 2 test body 2 test body 2 test body 2 test body 2 </description>
<link>http://www.mountainviewplayers.com/index.php</link>
<pubdate>2007-07-10</pubdate>
</item>

<item>
<title>Test heading 2</title>
<description>test body 2 test body 2 test body 2 test body 2 test body 2 test body 2 </description>
<link>http://www.mountainviewplayers.com/index.php</link>
<pubdate>2007-07-10</pubdate>
</item>

<item>
<title>Test heading 2</title>
<description>test body 2 test body 2 test body 2 test body 2 test body 2 test body 2 </description>
<link>http://www.mountainviewplayers.com/index.php</link>
<pubdate>2007-07-10</pubdate>
</item>

<item>
<title>Test heading 2</title>
<description>test body 2 test body 2 test body 2 test body 2 test body 2 test body 2 </description>
<link>http://www.mountainviewplayers.com/index.php</link>
<pubdate>2007-07-10</pubdate>
</item>

<item>
<title>Test heading 2</title>
<description>test body 2 test body 2 test body 2 test body 2 test body 2 test body 2 </description>
<link>http://www.mountainviewplayers.com/index.php</link>
<pubdate>2007-07-10</pubdate>
</item>

<item>
<title>Test heading 2</title>
<description>test body 2 test body 2 test body 2 test body 2 test body 2 test body 2 </description>
<link>http://www.mountainviewplayers.com/index.php</link>
<pubdate>2007-07-10</pubdate>
</item>

<item>
<title>Test heading 2</title>
<description>test body 2 test body 2 test body 2 test body 2 test body 2 test body 2 </description>
<link>http://www.mountainviewplayers.com/index.php</link>
<pubdate>2007-07-10</pubdate>
</item>

<item>
<title>Test heading 2</title>
<description>test body 2 test body 2 test body 2 test body 2 test body 2 test body 2 </description>
<link>http://www.mountainviewplayers.com/index.php</link>
<pubdate>2007-07-10</pubdate>
</item>

<item>
<title>Test heading 2</title>
<description>test body 2 test body 2 test body 2 test body 2 test body 2 test body 2 </description>
<link>http://www.mountainviewplayers.com/index.php</link>
<pubdate>2007-07-10</pubdate>
</item>
</channel>
</rss>


Any ideas on what is the problem?

NancyJ
07-17-2007, 10:20 AM
Does the validator say why it isnt valid?



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum