<?php

header
('Content-type: application/rss+xml');
echo(
'<?xml version="1.0" encoding="UTF-8"?>');

?><rss version="2.0">
 <channel>
  <title>Kirby Week 2008</title>
  <link>http://example.org/kirbyweek08/</link>
  <description>A description! YAY!</description>

<?php

require_once('db.php');

$getposts "SELECT * FROM posts ORDER BY id DESC LIMIT 0,10";
$getposts2 mysql_query($getposts);
$i=0;
while (
$getposts3[$i] = mysql_fetch_array($getposts2))
{
?>
  <item>
   <title><?php echo(htmlentities($getposts3[$i]['title'])); ?></title>
   <link>http://example.org/kirbyweek08/read.php?id=<?php echo($getposts3[$i]['id']); ?></link>
   <description><?php echo(htmlentities(strip_tags($getposts3[$i]['text']))); ?></description>
   <pubdate><?php echo(date('D, d M Y H:i:s O',strtotime($getposts3[$i]['pubDate']))); ?></pubdate>
  </item>
<?php
    $i
++;
}

?>
 </channel>
</rss>