PHP programmer of bangladesh
A PHP Programmer of Bangladesh

Creating RSS Feed [Beganing]

October 29th 2007 in PHP, Programming

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/

Trackbacks

close Reblog this comment
blog comments powered by Disqus

Regular Expression Example

Here i am providing some useful regular Expression which are acceptable by most of the web developers. I have found them in web.
Email Address validation
Expression: ^.+@[^\.].*\.[a-z]{2,}$

Description:
Most email validation regexps are outdated and ignore the fact that domain names can contain any foreign character these days, as well as the fact that anything before [...]

Regular Expression ExamplePrevious Entry

smashingmagazine.com

smashing Magazine is one of the best site that i ever find in the internet. i just heard about this. It published several articles on different aspect of programming. You can easily increase your technical knowledge from this. This site always updated with latest article, tutorial etc. It includes article and tutorial on

CSS, AJAX, PHP, [...]

smashingmagazine.comNext Entry

Where i am ???



Currently I am working in Right Brain Solution(RBS) as a Software Engineer(Team Leader). I start my journey in RBS from 6th Nov, 2007.
Where i Was???
I am a php professional from Bangladesh. I start my journey as a professional from 1st july, 2006 in EVOKNOW Incorporation. I was there for one and half year. My Position was there "Software Engineer(Lead Developer)". I left EVOKNOW at 5th Nov, 2007.
Self Formed
I do some freelancing work with some of my friends under this name. Our dream is to make it world famous in the field of web development & solution. If you would like to work with us, send us your proposal to technopeoplebd@gmail.com
Social Networks
View Md. Mahabubul Hasan Masud's profile on LinkedIn
Moonrise: What i feeling???
Feelings from moonrise
More items See these feelings on moonrise