动态地将不同的图像添加到我的RSS Feed中

时间:2014-03-31 16:46:46

标签: php rss

顺便提一下,即时通讯新手!

我的问题是我需要在我的RSS中显示我的网站中不同页面上的不同图像,并且所有图像都存储在我的服务器上的某个名为" allimages"这些页面是从我的数据库中提取的,我几乎到处都搜索和搜索,但我在SO中找到了与此问题相关的解决方案except here。我试图修改为我自己但是它在我错误的地方工作!?任何帮助将不胜感激

感谢名单。

下面是代码

    <?php
header("Content-type: text/xml");
$connection = mysql_connect( "------", "-----", "-----");
mysql_select_db("-------", $connection);
$selezionedati = "SELECT * FROM NEWSPAGES ORDER BY ID DESC LIMIT 20";
$query = mysql_query($selezionedati ) or die(mysql_error());

echo (" <rss version=\"2.0\"> ");
echo (" <channel> ");
echo (" <title>People</title>");
echo (" <link>http://tabata.com</link>");
echo (" <description>tabata</description> ");
echo " <copyright>Copyright 2013</copyright> \ n";
echo " <managingEditor>tabata(sun)</managingEditor> \ n";
echo " <webMaster>tabata.com (sun)</webMaster> \ n";
echo (" <language>IT- en</language>");
while($array = mysql_fetch_array( $query )) {
extract($array);
echo "<item>
<title>$title</title>
<link>http://tabata.com/news.php?page=$id</link>
<description><![CDATA[<img src=\"http://tabata.com/$allimages\" width=\"57\" height=\"57\" />]]>$description</description>
<image>
<link>http://tabata.com/news.php?page=$id</link>
<url>http://tabata.com/$allimages</url>
<title>$title</title>
</image>
</item>";
}
echo " </channel> </rss>" ;
?>

0 个答案:

没有答案