Need help building an rss feed

Discussion in 'XML & RSS' started by cnapsys, Jan 9, 2009.

  1. #1
    Hey guys,
    I need a bit of help understanding how to build an rss feed for a website.
    I've built the site in php/mysq.
    I have the news in a table with title/description/link

    Following a few tutorials found on the net I came up with this:

    <?xml version="1.0" encoding="UTF-8"?>
    <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
    <title>Site Title</title>
    <link>link</link>
    <description>Short description</description>
    <language>ro</language>
    <copyright>Company name</copyright>
    <lastBuildDate></lastBuildDate>
    <generator>generator...</generator>
    <webMaster>emailwebmaster</webMaster>
    		
    <item>
    <title>Short Title</title>
    <link>link</link>
    <pubDate>Fri, 09 Jan 2009 21:09:04 GMT</pubDate>
    <description>Short description for news</description>			
    <guid>link</guid>
    </item>
    <item>
    <title>Short Title</title>
    <link>link</link>
    <pubDate>Fri, 09 Jan 2009 21:09:04 GMT</pubDate>
    <description>Short description for news</description>			
    <guid>link</guid>
    </item>
    <atom:link href="link/feed.xml" rel="self" type="application/rss+xml" />
    </channel>
    </rss>
    Code (markup):
    Ok, so that's a basic code.
    What I want to do is be able to dynamically generate the titles/descriptions/links and dates with php.
    How would i go about doing that?
    I've tried using php tags inside the xml doc and they are completely ignored.
    I'm guessing the xml parser is completely different than the php, so any php tags are useless inside xml.
    Any help is greatly appreciated.

    c
     
    cnapsys, Jan 9, 2009 IP
  2. NinjaWork

    NinjaWork Guest

    Messages:
    132
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    try using .htaccess to redirect the request to a php file
     
    NinjaWork, Jan 18, 2009 IP