Below is the code I am using from a tutorial I found online. There are validation errors that I simply do not understand them. I've tested the feed on 3 different readers: Mozilla thunderbird, RssReader 1.0, and FeedReader 2.90.
You can test the feed at marcsteele.com/z.php in a rss reader.
FeedValidator.org gives me the following errors:
http://www.feedvalidator.org/check?url=http://www.marcsteele.com/z.php
The weird thing is that I can get it to work on my localhost, but not when I upload it to my server.
I am using IIS for the server, and apache for my localhost. I can't image why that would make a difference.
The only other issue I can image that is affecting the output is maybe apostrophes or special characters. Any help would be appreciated.
<?
header("Content-Type: text/xml;charset=utf-8");
$connection = @mysql_connect("localhost", "root", "password");
$db = @mysql_select_db('pl', $connection);
$sql = "SELECT * from products_description";
$result = @($sql, $connection);
ECHO <<<END
<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0">
<channel>
<title>Testing Oscommerce RSS Feeds</title>
<link>http://localhost/</link>
<description>Testing out Dynamic RSS feed from mysql.</description>
END;
while($row = mysql_fetch_array($result)) {
$name = $row['products_name'];
// display an item
ECHO <<<END
<item>
<title>$name</title>
<link></link>
<description></description>
</item>
END;
}
ECHO <<<END
</channel>
</rss>
END;
?>
Thanks!