IE6及一下输出xml为空,firefox下正常,怎么回事?

xingbulai 2008-02-25 05:07:50
<?php
require_once dirname(__FILE__)."/../config.inc";
require_once "$path_prefix/api/Content/Content.php";
require_once "$path_prefix/api/ContentCollection/ContentCollection.php";
require_once "$path_prefix/web/functions.php";

$rss_display_no = ConfigVariable::get("rss_display_no");
$display_num = get_rss_display_num($_GET['type'],$rss_display_no);
$uid = (int)@$_GET['uid'];

if ($uid) {
$feed = Content::get_content_feed_for_user($uid, $display_num);
}
else if ($_GET['type'] == 'all') {
$feed = Content::get_content_feed_for_user("",$display_num);
}
else if ($_GET['type'] == 'group_content' && $_GET['gid']) {
$feed = ContentCollection::get_feed_for_content_collection($_GET['gid'],$display_num);
}
else if ($_GET['type'] == 'group_forum') {
$feed = ContentCollection::get_feed_for_content_collection($_GET['gid'],$display_num,'group_forum');
}
else {
header("HTTP/1.0 404 Not Found");
?>No feed available at this address. Were you looking for the community blog feed?<?
exit;
}

header("Content-Type: application/xml");

print($feed); ?>

输出内容无中文,文件编码都是ANSI,
服务端为windows,在windows下浏览:在ie6,ie7,firefox都正常.(php版本5.2.1,apache2.0.59,默认字符集为utf-8)
服务端为linux,在windows下浏览:在ie6下显示为空,ie7下正常,firefox正常.(php版本5.0.4,apache2.0.54,默认字符集为utf-8)
在firefox查看了源代码是这样的:

<?xml version="1.0"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0"><channel><title>(TestCommon) TestCommon Network's Latest Blog</title><description>This is home network for TestCommon</description><link>http://www.mytcdev.com</link><lastBuildDate>Mon, 25 Feb 2008 09:02:57 +0000</lastBuildDate><item><title>post from linda</title><description>post from linda</description><link>http://www.mytcdev.com/content.php?cid=105</link><guid>http://www.mytcdev.com/content.php?cid=105</guid><pubDate>Mon, 18 Feb 2008 05:02:28 +0000</pubDate></item></channel></rss>



为什么在ie6下一直为空呢?
...全文
130 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
livsenwlb 2011-01-28
  • 打赏
  • 举报
回复
也来看看
Dleno 2008-05-01
  • 打赏
  • 举报
回复
估计:
1.<?xml version="1.0" encoding="utf-8"?>(加: encoding="utf-8")
2.header("Content-Type: application/xml");
改为:
header("Content-Type: text/xml");
knowledge_Is_Life 2008-05-01
  • 打赏
  • 举报
回复
lz要干嘛?
剑心永远OK 2008-04-15
  • 打赏
  • 举报
回复
和系统不兼容?
biggates_86 2008-04-15
  • 打赏
  • 举报
回复
删掉BOM试试
  • 打赏
  • 举报
回复
是不是跟服务器的什么配置有关???对linux服务器实在搞不懂!
服务端为windows,在windows下浏览:在ie6,ie7,firefox都正常
说明程序应该是没问题的
只能说是跟linux服务器有关了

21,890

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧