Nge-Blog ala Kang Yunan


Kehidupan, IT, Teknologi Informasi, Gosip, Film, Artis, Budi Anduk, Sosial, Komunitas, Pemerintahan, Rumah Tangga, Masyarakat, Kuliner, Makanan, New Idea, Sport, Olahraga, Liputan, Ulasan, Renungan, Agama, Islam

Create RSS Feed on your Website

Very simple to create RSS feed. You just add header of XML file on your page header, and select from table and loop your data into xml format.

$query = “select address, cat, desc, title from `category` limit 15″;
$result = mysql_query($query, $link);

while ($line = mysql_fetch_assoc($result))
$return[] = $line;

$now = date(”D, d M Y H:i:s T”);

$output = “<?xml version=\”1.0\”?>
<rss version=\”2.0\”
<title>Judul RSS FEED</title>
<description>Deskripsi RSS</description>

foreach ($return as $line)
$output .= “<item><title>”.htmlentities($line[’title’]).”</title>

$output .= “</channel></rss>”;
header(”Content-Type: application/rss+xml”);
echo $output;


Filed under: Internet, Programming, Web Application, , ,

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s

%d bloggers like this: