Jump to content

Output rss

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
4 replies to this topic

#1
dirkfirst

dirkfirst

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 354 posts
How do I output RSS?

I've created a project like:

<?php

// Print our RSS
print "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>\n\n";
print "<!DOCTYPE rss PUBLIC \"-//Netscape Communications//DTD RSS 0.91//EN\" \"http://my.netscape.com/publish/formats/rss-0.91.dtd\">\n";
print "<rss version=\"0.91\">\n";
print "		<channel>\n";
print "			<title>Text Ads</title>\n";
print "			<description>Ads</description>";
print "			<language>en</language>\n";

?>

But it doesn't show up in XML format when I load the webpage. Anyone know why?

#2
TkTech

TkTech

    The Crazy One

  • Moderators
  • 1,396 posts
your missing the endings for one thing, such as </channel>, which creates invalid xml anyways.

Try looking at http://www.xul.fr/en-xml-rss.html which is a great site for creating rss feeds, its where I learned from.

Whenever I need to use RSS for output, I use RSSWriter.
http://usefulinc.com/rss/rsswriter/

Very handy and easy to use, expecialy for large sites/projects.

#3
dirkfirst

dirkfirst

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 354 posts
Well, I do have the ending tags but I didn't post all of the code.

I'll take a look at the rsswriter. What I've done so far seems to be read fine by other XML readers. No idea why it doesn't show up properly in the browser.

#4
Nightracer

Nightracer

    Programmer

  • Members
  • PipPipPipPip
  • 131 posts
Looks fine to me. What were you using to test it?

#5
dirkfirst

dirkfirst

    Programming Expert

  • Members
  • PipPipPipPipPipPip
  • 354 posts
I was just going to the URL in FireFox. FF loads up rss differently but it wouldn't load mine that way. In the end, RSS readers read the data fine though. Not sure what the problem here was.