graham23s Posted February 7, 2009 Share Posted February 7, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/144206-rss-feed/ Share on other sites More sharing options...
RichardRotterdam Posted February 7, 2009 Share Posted February 7, 2009 When does the error occure? and what does the xml output look like when you check the source in the browser? Quote Link to comment https://forums.phpfreaks.com/topic/144206-rss-feed/#findComment-756940 Share on other sites More sharing options...
graham23s Posted February 7, 2009 Author Share Posted February 7, 2009 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 Quote Link to comment https://forums.phpfreaks.com/topic/144206-rss-feed/#findComment-756983 Share on other sites More sharing options...
peranha Posted February 7, 2009 Share Posted February 7, 2009 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> Quote Link to comment https://forums.phpfreaks.com/topic/144206-rss-feed/#findComment-756992 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.