Jump to content

[SOLVED] Small Problem? RSS Feed Not Validating


toxictoad

Recommended Posts

Hi I'm getting an error when I run my code

the error is here:

echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";

I ran the page through the w3c validator and it points to the last " as being wong?

 

this is the full code

<?php
header("Content-type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
// Set RSS version.
echo "
<rss version=\"2.0\"> ";
// Start the XML.
echo "
<channel>
<title>This is the title</title>
<description>Information to describe the overall content of this feed</description>
<link>http://www.phatjoints.com/</link>";
// Create a connection to your database.
require("config.php");
// Query database and select the last 10 entries.
$data = mysql_query("SELECT * FROM rssnews ORDER BY id DESC LIMIT 10");
while($row = mysql_fetch_array($data))
{

// Continue with the 10 items to be included in the <item> section of the XML.
echo "
<item>
<link>http://www.phatjoints.com/rsstest.php?id=".$row[id]."</link>
<guid isPermaLink=\"true\">http://www.phatjoints.com/rsstest.php?id=".$row[id]."</guid>
<title>".$row[Title]."</title>
<description><![CDATA[".$row[Content]."]]></description>
<comments>http://www.phatjoints.com/rsstest.php?id=".$row[id]."#Comments</comments>
</item>";
}
echo "
</channel>
</rss>";
?>

 

anyone help?

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.