Hi, i have made a rss feed that automatically updates, what i done use php to grab information from the database as new content is added in xml. Everything seems okay but when i click subscribe to rss feed it displays "Failed to load feed". My extension is .php is there any way that can be a problem? I am a little new in making rss feeds in php so any help is appreciated.
Heres my code.
<?php
include("../scripts/connect_to_mysql.php");
header("Content-Type: application/xml; charset=ISO-8859-1");
echo '<?xml version="1.0" encoding="ISO-8859-1" ?>
<?xml-stylesheet type="text/xsl" ?>
<rss version="2.0">
<channel>
<title>Example - Latest Content</title>
<link>http://example.com</link>
<description>Latest Content On http://example.com</description>';
$query = "SELECT * FROM table ORDER BY dateadded DESC limit 15";
$result = mysql_query($query);
while($row = mysql_fetch_assoc($result))
{
$name = $row['name'];
$featured = $row['featured'];
$description = $row['description'];
$release = $row['released'];
$information = $row['information'];
$dateadded = $row['dateadded'];
$dateadded = date("r", strtotime($dateadded));
echo '
<item>
<id>' . $information . '</id>
<featured>' . $featured . '</featured>
<title>' . $name . '</title>
<description>' . $description . '</description>
<release>' . $release . '</release>
<link>http://example.com/category/information?information=' . $information . '</link>
<enclosure url="http://example.com/category/information?information=' . $information . '"/>
<pubDate>' . $dateadded . '</pubDate>
</item>
';
}
echo "</channel>
</rss>";
?>