RSS Feed Reader上传Feed时显示错误

时间:2015-06-15 12:54:03

标签: php mysql xml rss rss-reader

今天我创建了我的第一个RSS Feed。但我在rss阅读器和#34;桌面代码"上传rss时遇到问题。当我添加mu rss url时,它会显示一个错误"格式错误的XML文档: 有谁可以检查我的代码?请帮帮我 谢谢。

   <?php
include_once'connect.php';
header ('Content-Type: text/xml: charset="ISO-8859-1"');

echo '<?xml version="1.0" encoding="ISO-8859-1"?>';

?>

<rss version="2.0">
<channel>
<title> PACRA RSS FEEd </title>
<link> http://www.pacra.com </link>
<description>PACRA PAKISTAN </description>

<?php
$query = "SELECT og_ratings.client_id, og_ratings.press_release, og_ratings.dissemination_date, og_companies.name
FROM og_ratings 
LEFT JOIN og_companies
ON og_ratings.client_id = og_companies.id
ORDER BY dissemination_date DESC LIMIT 10";
$result = mysql_query ($query) or die ("Could not execut query");

 while($row=mysql_fetch_assoc($result)){
    $cid = $row ['client_id'];
    $cname = $row ['name'];
    $pr = $row ['press_release'];
    $dd = $row ['dissemination_date']; 


     ?>


     <item>
     <title> <?php echo $cname; ?></title>
     <description> <?php echo $cname; ?></description>
          <link><?php echo "http://192.172.100.4/pacra/".$pr; ?></link>


     </item>
     <?php
 }
 ?>


</channel>
</rss>

这是Generated XML

<?xml version="1.0" encoding="ISO-8859-1"?>
<rss version="2.0">
<channel>
<title> PACRA RSS FEEd </title>
<link> http://www.pacra.com </link>
<description>PACRA PAKISTAN </description>



     <item>
     <title> Pakistan Income Fund</title>
     <description> Pakistan Income Fund</description>
          <link>http://192.172.100.4/pacra/uploads/press_release/PIF_PR_20Feb14.pdf</link>


     </item>


     <item>
     <title> Pakistan Income Enhancement Fund</title>
     <description> Pakistan Income Enhancement Fund</description>
          <link>http://192.172.100.4/pacra/uploads/press_release/PIEF_PR_20Feb14.pdf</link>


     </item>


     <item>
     <title> MCB Islamic Income Fund</title>
     <description> MCB Islamic Income Fund</description>
          <link>http://192.172.100.4/pacra/uploads/press_release/MCBIIF_PR_20Feb14.pdf</link>


     </item>


     <item>
     <title> MCB Cash Management Optimizer Fund</title>
     <description> MCB Cash Management Optimizer Fund</description>
          <link>http://192.172.100.4/pacra/uploads/press_release/MCB CMOP_PR_20Feb14.pdf</link>


     </item>


</channel>
</rss>

0 个答案:

没有答案