PHP Programmer’s Of Bangladesh

Creating RSS Feed [Beganing]

Posted by: Md. Masud on: October 29, 2007

RSS Feed is one of the best thing in modern web world. But most of the time we are not able to create our own RSS Feed. But can you imagine its simply easy when you know how to write them. Here is a beganing example to write a RSS Feed:

<?php

header( ‘Content-type: text/xml’);

?>

<rss version=”2.0″>
<channel>
<title> WordPress </title>
<description> This is a test site for WordPress </description>
<link> phpprogrammerofbangladesh.wordpress.com </link>

<?php

mysql_connect( ‘localhost’, ‘root’, ” ) or die( mysql_error() );
mysql_select_db( ‘wordpress’) or die( mysql_error() );

$sql_query = “select ID, post_date, post_title, post_content from wp_posts ORDER BY post_date DESC LIMIT 0,5″;

$result     = mysql_query( $sql_query );
while( $row = mysql_fetch_row( $result ) )
{
?>
<item>
<title>       <?=htmlentities(strip_tags($row[2]));?>             </title>
<description> <?=htmlentities( strip_tags($row[3]) );?>           </description>
<link> http://localhost/wordpress/index.php?post_id=<?=$row[0];?> </link>
<pubDate>     <?=$row[1];?>                                       </pubDate>
</item>
<?php
}
?>
</channel>
</rss>

You can have more details about RSS Feed Creation from the following links

  • http://www.tiffanybbrown.com/2005/12/22/dynamic-rss-feeds-using-php-mysql-and-apache
  • http://www.owalog.com/blog.php?myess1=47
  • http://www.tutorialized.com/view/tutorial/Creating-Dynamic-RSS-Feeds-with-PHP-and-MySQL/15948
  • http://www.devshed.com/c/a/MySQL/Creating-an-RSS-Reader-the-Reader/

5 Responses to "Creating RSS Feed [Beganing]"

Feed Editor by Extralabs Software is great for making RSS

Helpful instruction
keep all the good works going… buddy :)

Seems to be a pretty simple technique to build RSS. You can get ready made scripts also!!

Very helpful. Thank you mate. I’ll try this.

Leave a Reply

Where I was???

I was a PHP/MySQL web application developer in EVOKNOW INC from 1st July, 2006 to 5th Nov, 2007.

Blog Stats

  • 26,866 hits

What is the date?????

October 2007
S S M T W T F
« Sep   Nov »
 12345
6789101112
13141516171819
20212223242526
2728293031  

My Links in Del.icio.us

Google Adds