Today i create my first rss feed. but i face problem while uploading rss in rss reader "Desktop Ticker". When i add mu rss url it show me a error " Badly formed XML document: Can anyone please check my code? and help me please. Thank you.
<?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>
Here is the 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>