在过去的6周里,我一直在使用php和mysqli开发自定义社交网络。无论如何,我今天决定为博客系统创建一个feed。我已经使用w3 feed验证服务检查了我的脚本,它运行正常! 问题是没有任何提要出现在页面上,这是我的脚本.....>
<?php include"php_includes/db_conx.php"; ?>
<?php header('Content-type: text/xml'); ?>
<?php echo '<?xml version="1.0" encoding="iso-8859-1"?>';
?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>Birdbooks Blog Feed</title>
<description>Birdbook is a Social Network with Birders in mind</description>
<link>http://www.birdbook.org.uk/</link> <copyright> copyright 2013 Birdbook Social Network</copyright>
<atom:link href="http://www.birdbook.org.uk/feed/" rel="self" type="application/rss+xml" />
<?php $query = "SELECT * FROM 'blog' ORDER BY 'delimiter' DESC LIMIT 0,15";
$results = $db_conx->query($query);
$number = $results->num_rows;
for ($i = 1; $i <= $number; $i++) {
$row = $results->fetch_assoc();
$title = $row['blogtitle'];
$description = $row['description'];
$link = $row['linklabel'];
$date = date("r", $row['lastmodified']);
?>
<item>
<title><?php echo $title; ?></title>
<description><?php echo $description; ?></description>
<link><?php echo $link; ?></link>
<pubDate><?php echo $date; ?></pubDate>
<guid><?php echo $link; ?></guid>
</item>
<?php } ?>
</channel>
</rss><?php $db->close(); ?>
有人有什么想法吗? 非常感谢.. Phillip Dews