The code below should produce my homepage but it doesnt display the stuff from the database, the page works by setting the content as the $content variable and then replacing it in the template file to make the page, any ideas?
$content = '<div id="leftindex">';
if ($db_found) {
$SQL = "SELECT * FROM articles WHERE show = 'yes'";
$result = mysql_query($SQL);
while ($db_field = mysql_fetch_assoc($result)) {
$content.='<div id=\"par\"><h2>';
$content.= $db_field['title'];
$content.='</h2><p>';
$content.= $db_field['story'];
$content.='</p></div>';
}
mysql_close($db_handle);
}
else {
print "Database NOT Found ";
mysql_close($db_handle);
}
$content.='</div>
<div id="rightindex">
<div id="par"><h2>Follow us...</h2>
<p><table><tr><td><img src="/template/images/fblogo.png"></td><td><a href="" class="general">Facebook</a></td></tr>
<tr><td><img src="/template/images/rsslogo.png"></td><td><a href="" class="general">RSS</a></td></tr></table>
</p>
</div>
<div id="par"><h2>Weather</h2>
<iframe src="/template/weather.html" border="0" height="190px" width="248px" scrolling="no" style="border:0px;"></iframe>
</div>
</div>';
$template = file_get_contents('template/template.html');
function makepage(){
global $content, $template;
$template = str_replace('@FCC_BODY@',$content,$template);
die($template);
}
makepage();