Jump to content

outputting valid rss in php


bullchina

Recommended Posts

I have a database with news entries in it in mysql, i'm grabbing the data, and then trying to output that data as a valid rss feed, but the feed just shows up as text in the browser. i must be missing something, but when i view the source code, it looks identical to every other rss feed i've ever seen. the code to generate the rss is in a smarty tpl file":

[code]<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:wfw="http://wellformedweb.org/CommentAPI/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
>
  <channel>
    <title>Roldan + Berengue, arqts.</title>
    <link>http://www.roldanberengue.com/</link>
    <description>News from the office of Miguel Roldan and Merce Berengue</description>
    <language>en-us</language>
    <pubDate>{$news[0].date}</pubDate>
    <docs>http://blogs.law.harvard.edu/tech/rss</docs>
    <managingEditor>dvmorris@gmail.com</managingEditor>
    <webMaster>dvmorris@gmail.com</webMaster>
<image>
<url>http://arquitectes.coac.net/images/rss.jpg</url>
<title>Roldan + Berengue, arqts.</title>
<link>http://www.roldanberengue.com/</link>
</image>
{foreach from=$news item=item key=key}
    <item>
      <title>{$item.title}</title>
      <link>{$item.hyperlink}</link>
      <description>{$item.description}</description>
      <pubDate>{$item.date}</pubDate>
  {if $item.enclosure != ""}
  <enclosure url="{$item.enclosure}" length="{$item.bytes}" type="{$item.type}" />
  {/if}
    </item>
{/foreach}
  </channel>
</rss>[/code]

but it shows up like this: http://dave.showviz.net/rbweb/news/rss/

no clue what's wrong, but i know it's something simple. thanks for your help,
dave
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.