I'm lost on this one. This code works fine in Firefox, but not my IE8. I think it has something to do with the <?php echo '<?xml version="1.0" encoding="utf-8"?>'; ?> line, but i'm not sure. IE says "Internet Explorer cannot display this feed" and "A name contained an invalid character. Line: 7 Character: 701." Any ideas?
<?php header('Content-Type: text/xml'); ?>
<?php echo '<?xml version="1.0" encoding="utf-8"?>'; ?>
<?php include('../vars.php'); ?>
<rss version="2.0">
<channel>
<title>Newsfeed</title>
<description>News and Updates</description>
<link>http://www.example.com</link>
<language>en-us</language>
<?php
require_once("../conn.php");
$query = "SELECT * FROM news";
$data = mysqli_query($db, $query);
while ($row = mysqli_fetch_array($data)) {
echo '<item>';
echo ' <title>' . $row['title'] . ' - ' . substr($row['content'], 0, 32) . '...</title>';
echo ' <link>http://www.example.com/new.php?newsid=' . $row['newsid'] . '</link>';
//echo ' <pubDate>' . $row['date'] . '</pubDate>';
echo ' <description>' . $row['content'] . '</description>';
echo '</item>';
}
?>
</channel>
</rss>