Forum Moderators: coopster

Message Too Old, No Replies

Making an rss feed in a php file

Does it have to be an external xml?

         

nfs2

8:21 pm on May 22, 2006 (gmt 0)

10+ Year Member



I've never used rss so making it is giving me some trouble.. As far as i know, its simply some xml code that gives the title, description and link to the content, right?

Im trying to add it to my blog (for no other reason then blogs are supposed to have rss feeds) but it seems i need to put it into an external xml file. the <?xml?> tag gives an error in the php file

But the problem is, since its a blog and the content is made dynamically, how do i do that? Isnt there some way to make the feed from within the php file?

Im sure this is probably easy for most of you, but trying to make something you've never even used before is hard :/

san_garrafa

10:38 pm on May 22, 2006 (gmt 0)

10+ Year Member



Hello nfs2

Are you using a php app to build your blog? Most of them have already the functionality to generate rss feeds automatically. You should check it out. Maybe if you tell me what are you using I can be of more assistance.

Regards.

nfs2

2:47 am on May 23, 2006 (gmt 0)

10+ Year Member



Hi, i've built my blog from scratch (with plenty of help from webmastersworld ;) )

I've figured out that i needed

header('Content-type: text/xml');

Instead of

<?xml?>

san_garrafa

4:10 am on May 23, 2006 (gmt 0)

10+ Year Member



cool :)

you can also use:
<? echo '<?xml?>';?>

Personally I use a php class (RSS builder) to generate valid rss xml's
You can find it here:
[sourceforge.net ]