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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.