madddidley
08-09-2005, 10:22 AM
I have this page and for some reason I get an error that says
The following tags were not closed: rss, channel, item.
Any help would be appreciated...
Thank,
maddDidley.com
<?php
//error_reporting(E_ALL^E_NOTICE);
mysql_connect("localhost");
mysql_select_db("madddidley");
// Let us first make sure the php file is
// interpeted as xml information
header ("Content-Type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>";
// SQL connection
$query = "SELECT * FROM posts ORDER BY post_id DESC";
$go = mysql_query($query);
$num = mysql_num_rows($go);
echo mysql_error();
if($num == 0)
{
exit;
}
else
{
// First we print the overall xml information
echo "<rss version=\"2.0\">";
echo "<channel>";
// Here comes the global title for you rss
echo "<title>maddnews</title>";
// Here comes the url for the page that the rss applies for
echo "<link>http://www.maddDidley.com/</link>";
// Here comes a short description of the page
echo "<description>maddDidley's Blog Newsfeed</description>";
// Now over to the dynamic part
while($a=mysql_fetch_object($go)) {
//$blog_title = stripslashes($sql->title);
//$blog_link = "blog.php?ID=".$sql->id;
//$blog_description = stripslashes($sql->header);
echo "<item>";
echo "<title>$a[ttitle]</title>";
echo "<link>http://www.maddDidley.com</link>";
echo "<description>";
echo "$a[comments]";
echo "</description>";
echo "</item>";
}
// And at last the closing tags for the overall info
echo "</channel>";
echo "</rss>";
}
?>
The following tags were not closed: rss, channel, item.
Any help would be appreciated...
Thank,
maddDidley.com
<?php
//error_reporting(E_ALL^E_NOTICE);
mysql_connect("localhost");
mysql_select_db("madddidley");
// Let us first make sure the php file is
// interpeted as xml information
header ("Content-Type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"ISO-8859-1\" ?>";
// SQL connection
$query = "SELECT * FROM posts ORDER BY post_id DESC";
$go = mysql_query($query);
$num = mysql_num_rows($go);
echo mysql_error();
if($num == 0)
{
exit;
}
else
{
// First we print the overall xml information
echo "<rss version=\"2.0\">";
echo "<channel>";
// Here comes the global title for you rss
echo "<title>maddnews</title>";
// Here comes the url for the page that the rss applies for
echo "<link>http://www.maddDidley.com/</link>";
// Here comes a short description of the page
echo "<description>maddDidley's Blog Newsfeed</description>";
// Now over to the dynamic part
while($a=mysql_fetch_object($go)) {
//$blog_title = stripslashes($sql->title);
//$blog_link = "blog.php?ID=".$sql->id;
//$blog_description = stripslashes($sql->header);
echo "<item>";
echo "<title>$a[ttitle]</title>";
echo "<link>http://www.maddDidley.com</link>";
echo "<description>";
echo "$a[comments]";
echo "</description>";
echo "</item>";
}
// And at last the closing tags for the overall info
echo "</channel>";
echo "</rss>";
}
?>