<? header("Content-Type: text/xml;charset=utf-8"); ?>
<?
// prepare HTML text for use as UTF-8 character data in XML
function cleanText($intext) {
    return utf8_encode(
        htmlspecialchars(
            stripslashes($intext)));
}
?>
<?
//connect to the database
include("connections/conn_blog.php");
echo <<<END
<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet href="stylesheets/rss.css" type="text/css"?>
END;
?>
<rss version="2.0">
<channel>
<title>Pedagogically Correct</title>
<description>Many people understand that education is in desperate need of reform, but few recognize how radical the reform must be. What is needed is not a bigger education budget, a stronger teacher's union, smaller class sizes, or more rigorous testing procedures. But neither is the solution simply a return to Classical Education. What is needed is a basic, pedagogical revolution&#8212;a revolution in the science of education&#8212;a revolution in the selection of content taught to students, and the method by which that content is presented. VanDamme Academy is the leader of that revolution. Pedagogically Correct is our newsletter.</description>
<link>http://www.pedagogicallycorrect.com/</link>
<copyright>2007 VanDamme Schools, Inc.</copyright>

<?
$q="SELECT id,title,description,body,UNIX_TIMESTAMP(pubdate) AS pubDate
FROM articles ORDER BY pubDate DESC LIMIT 0,15";

$doGet=mysql_query($q);

while($result = mysql_fetch_array($doGet)){
?>
     <item>
	 	<category><?=htmlentities(strip_tags($result['category'],'ENT_QUOTES'));?></category>
        <title><?=htmlentities(strip_tags($result['title'])); ?></title>
		<pubDate><?=strftime( "%a, %d %b %Y %T %Z" , $result['pubDate']); ?></pubDate>
        <description><?=htmlentities(strip_tags($result['description'],'ENT_QUOTES'));?></description>
        <guid>http://www.pedagogicallycorrect.com/index.php?p=<?=$result['id']?></guid>     
     </item>  
<? } ?>
</channel>
</rss>