Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.