<? header('Content-type: text/xml'); ?>
<rss version="2.0">
<channel>
<title>Perkins CC</title>
<description>The latest at Perkins CC, Shropshire</description>
<link>http://www.perkinscc.co.uk</link>
<copyright>(c)Perkins CC</copyright>

<?
include "/home/perkins/public_html/account.inc"; 
require $dbconnection;

$sql = mysql_query("SELECT * FROM news order by date DESC");

while ($row = mysql_fetch_array($sql)) 
{

	$id = $row["id"]; //name of field
	$title = $row["title"];
	$date = $row["date"]; 
	$body = $row["body"]; 

	//$outputtime = date("d/m/Y - G:i", $date);  
	$outputtime = date("D, d M Y G:i", $date);  

	$title = stripslashes($title);
	$body = stripslashes($body);
	$body = ereg_replace("&","and",$body);
	$body = ereg_replace("\n","<br />",$body);

?> 
     <item> 
        <title><? echo $title; ?></title> 
        <description><? echo $body; ?></description> 
        <link>http://www.perkinscc.co.uk/news_view.php?id=<? echo $id; ?></link> 
		<guid isPermaLink="true">http://www.perkinscc.co.uk/news_view.php?id=<? echo $id; ?></guid>
        <pubDate><? echo $outputtime; ?> GMT</pubDate> 
     </item>    
<?
}
?>  

</channel>
</rss>
