Jump to content

RSS feed


graham23s

Recommended Posts

Hi Guys,

 

My RSS feed is throwing up some errors (There are errors in your feed)

 

code:

 

<?php
include("inc/inc-dbconnection.php");
header('Content-type: text/xml'); 
?>
<rss version="2.0" encoding="utf-8">
<channel>
<title>Firstchoicepharmacy.co.uk</title>
<description>First Choice Pharmacy - Cheap Online UK Pharmacy</description>
<link>http://www.firstchoicepharmacy.co.uk/</link>
<copyright>2009 Firstchoicepharmacy.co.uk</copyright>

<?php
$q_rss = "SELECT * FROM `fcp_products` ORDER BY `date_added` DESC LIMIT 30";
$r_rss = mysql_query($q_rss);

while ($a_rss = mysql_fetch_array($r_rss))
{

// vars
$rss_id = $a_rss['id'];
$rss_nm = htmlentities($a_rss['product_name']); 
$rss_de = strip_tags($a_rss['product_description']);
$rss_dt = $a_rss['date_added'];

?>
<item>
     <title><![CDATA[<?php print("$rss_nm"); ?>]]></title> 
     <description><![CDATA[<?php print("$rss_de"); ?>]]></description> 
     <link>http://www.firstchoicepharmacy.co.uk/product-information.php?productid=<?php print("$rss_id"); ?></link>
     <pubDate><?php print("$rss_dt"); ?></pubDate>
</item>  
<?php
} 
?>  
</channel>
</rss>

 

have i missed naything out can anyone see?

 

thanks guys

 

Graham

Link to comment
https://forums.phpfreaks.com/topic/144206-rss-feed/
Share on other sites

Hi Mate,

 

When i run the url through the validator:

 

http://www.firstchoicepharmacy.co.uk/rss.php

 

The errors are:

 

'utf8' codec can't decode byte 0x99 in position 1459: unexpected code byte (maybe a high-bit character?) [help]

 

In addition, interoperability with the widest range of feed readers could be improved by implementing the following recommendations.

 

line 26, column 0: item should contain a guid element (30 occurrences) [help]

 

</item>  line 46, column 15: description contains bad characters (3 occurrences) [help]

 

Optrex Actimist? Liposomal Eye Spray provides instant relief for the symptom ...              ^line 349, column 75: title should not contain HTML: & [help]

 

    <title><![CDATA[Canesten Cream Combi Internal & External Creams]]>< ...                                                                          ^line 619, column 0: Missing atom:link with rel="self" [help]

 

</channel>

 

if that pin points anything

 

thanks mate

 

Graham

Link to comment
https://forums.phpfreaks.com/topic/144206-rss-feed/#findComment-756983
Share on other sites

you are missing the guid element.

 

     <title><![CDATA[<?php print("$rss_nm"); ?>]]></title>
     <description><![CDATA[<?php print("$rss_de"); ?>]]></description>
     <link>http://www.firstchoicepharmacy.co.uk/product-information.php?productid=<?php print("$rss_id"); ?></link>
     <guid>http://www.firstchoicepharmacy.co.uk/product-information.php?productid=<?php print("$rss_id"); ?></guid>
     <pubDate><?php print("$rss_dt"); ?></pubDate>

Link to comment
https://forums.phpfreaks.com/topic/144206-rss-feed/#findComment-756992
Share on other sites

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.