Forum Moderators: open
Warning: MagpieRSS: Failed to parse RSS file. (xml declaration not at start of external entity at line 1, column 1) in /home/example/public_html/testserv/rssdemo/magpierss/rss_fetch.inc on line 238
Problem with: <snip>
any help will be really appreciated. here is the code to get the data out of mysql and get the clea xml.
<?php
include("dbinfo.inc.php");
$dbconnect = mysql_pconnect(localhost,$username,$password);
mysql_select_db($database, $dbconnect);
$query = "SELECT id, title, itemcomment, picturelink FROM jos_seyret_items WHERE featured='1' order by id desc limit 15";
$result = mysql_query($query, $dbconnect);
while ($line = mysql_fetch_assoc($result))
{
$return[] = $line;
}
$now = date("D, d M Y H:i:s T");
$output = "<?xml version=\"1.0\"?>
<rss version=\"2.0\">
<channel>
<title>What's hot</title>
<link>http://www.example.com/RSS/whatshot.php</link>
<description>Latest Video on example.com</description>
<language>en-us</language>
<pubDate>$now</pubDate>
";
foreach ($return as $line)
{
$output .= "<item><title>".htmlentities($line['title'])."</title>
<link>http://www.example.com/index.php?option=com_seyret&Itemid=27&task=videodirectlink&id=".htmlentities($line['id'])."</link>
<description>".htmlentities(strip_tags($line['itemcomment']))."</description>
</item>";
}
$output .= "</channel></rss>";
header("Content-Type: application/rss+xml");
echo $output;
?>
[edited by: bill at 1:07 am (utc) on Nov. 14, 2007]
[edit reason] No links to examples or URLs in your code please [/edit]