Jump to content

RSS FEED IE8


eekeek

Recommended Posts

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>

Link to comment
https://forums.phpfreaks.com/topic/215158-rss-feed-ie8/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.