【发布时间】:2011-02-09 13:34:48
【问题描述】:
我只是不明白发生了什么,几个月来我没有对网站进行任何更改,但现在突然 rss 提要不再工作了。
我用以下代码创建了一个 php 文件:
header('Content-type: text/xml');
include("config/config.inc.php");
$result = mysqli_query($link, "SELECT * FROM tutorials ORDER BY tutorial_id DESC LIMIT 50");
?>
<rss version="2.0">
<channel>
<title>CMS tutorial site</title>
<description>Bringing you the best CMS tutorials from the web</description>
<link>http://cmstutorials.org</link>
<?php
while($row = mysqli_fetch_object($result))
{
$user = mysqli_fetch_object(mysqli_query($link, "SELECT * FROM user_extra WHERE userid=".$row->user_id.""));
?>
<item>
<title><?php echo $row->title; ?></title>
<author><?php echo $user->username; ?></author>
<description><?php echo $row->description; ?></description>
<pubDate><?php echo $row->date; ?></pubDate>
<link>http://cmstutorials.org/view_tutorial.php?tutorial_id=<?php echo $row->tutorial_id; ?></link>
</item>
<?php
}
?>
</channel>
</rss>
我通过在 phpmyadmin 中执行查询来检查它,它可以工作,没有给出任何错误。当我删除标题内容类型和 rss 标签时,它将打印出查询中的每一行,但提要不会显示任何内容
这是提要的链接http://cmstutorials.org/rss(或http://cmstutorials.org/rss.php)
【问题讨论】: