How to produce RSS feeds from my site?

Discussion in 'Search Engine Optimization' started by seodelhi, Oct 28, 2005.

  1. #1
    I am new to the RSS concept, just wondering how can i produce RSS feeds for the new content in my site, my site uses php and mysql.

    If anybody have any ideas, then please post those here..

    thanx in advance.
     
    seodelhi, Oct 28, 2005 IP
  2. dave487

    dave487 Peon

    Messages:
    701
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Try this.
    <?php
    
    
     header('Content-type: text/xml'); 
    echo "<" . "?" . "xml version=\"1.0\" encoding=\"ISO-8859-1\"" . "?" . ">";
    
    
    ?>
    <rss version="2.0"><channel>
    	<title>My News Feed</title>
    	
    	<link>http://www.my site.org.uk</link>
    	<description>My News Feed</description>
    	<language>en-gb</language>
    	<lastBuildDate>Mon, 27 Jun 05 13:37:16 GMT</lastBuildDate>
    	<copyright>Copyright: (C) mysite.org.uk</copyright>
    	<docs>http://www.mysite.org.uk</docs>
    	<ttl>0</ttl>
    		
    		
    <?php
    //make your database loop through each news item to output the following part for each item.
    
    		echo"<item><title>$item_title</title>";
    		echo"<description>$description</description>";
    		echo"<link>http://www.mysite.org.uk/index.php3?q=$id</link>";
    		echo"<pubDate>$displaydate</pubDate></item>";
    
    
    ?>
    
    </channel>
    </rss>
    PHP:
     
    dave487, Oct 29, 2005 IP