Creating RSS Feed [Beganing]
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/

Add New Comment
Thanks. Your comment is awaiting approval by a moderator.
Do you already have an account? Log in and claim this comment.
Add New Comment
Trackbacks