Hi Im trying to create a news feed using php. I have a php code written which connects to the database and retrieves information which is converted into XML. The file is however a .php and when I try to parse it using google reader it dosen't work because it only reads files which are XML. Here's my code:
<?php
header("Content-type: text/xml");
$dept = $_GET['dept'];
require_once ("/var/www/html/http/sass/includes/config.inc.php");
require_once ("sass_news.php");
$sassNews = paginate('sass_news', 'sass_news', $numResults, $offset, $order, $condition);
if($sassNews) {
$xml_output = "<?xml version=\"1.0\"?>
";
$xml_output .= "<entries>
";
foreach($sassNews as $newsDetail){
$xml_output .= "\t<entry>
";
$xml_output .= "\t\t<date>" . $newsDetail->news_start_date . "</date>
";
$xml_output .= "\t\t<text>" . $newsDetail->news_body_en . "</text>
";
$xml_output .= "\t</entry>
";
}
$xml_output .= "</entries>";
echo $xml_output;
}
?>