我有此代碼爲我的RSS,但是當我把它添加到任何RSS閱讀器 如Outlook例如....我沒有看到說明。 我只看到了標題和鏈接。我看不到任何描述由我的rss?
這是我的代碼:
<?php
// Database settings
include("config.php");
@header('(anti-spam-(anti-spam-(anti-spam-(anti-spam-content-type:)))) text/xml'); // Must declare the content type
echo '<?xml version=\'1.0\' encoding=\'UTF-8\'?>';
$name_site="test ";
$dat = date("j/n/Y",time());
// Set RSS version.
echo '
<rss version=\'2.0\'> ';
// Start the XML.
echo "
<channel>";
echo "<title>".$name_site." RSS</title>\n";
echo "<link>".$pathsite."</link>\n";
echo "<description>test</description>\n";
echo "<date>".$dat."</date>\n";
$url=$_SERVER['SERVER_NAME'];
$data = mysql_query("select * FROM `vacancies` order by id desc limit 50");
while($row = mysql_fetch_array($data))
{
echo "
<item>
<title>$row[entitle]</title>
<description>$row[entxt]</description>
<date>$row[date]</date>
<link>http://$url/showjob.$row[id].html</link>
</item>";
}
echo '
</channel>
</rss>';
?>
任何幫助,請顯示完整的描述。
這些都是一些可笑的換行符。 – BoltClock 2012-02-19 10:38:29
你只是看不到文本,或者在返回給客戶端的XML中缺少文本? – home 2012-02-19 10:50:06