图片白色在php页面中输入rss

时间:2013-11-28 20:10:37

标签: php mysql xml rss

[Feed RSS] 你好,我有一个博客,我创建了这个rss文件,我把链接到照片,但使用rss阅读器,我无法查看它们。我哪里错了?

    <? php
$ connection = mysql_connect ( "xxx ", " xxx" , "xxx ");
mysql_select_db ( "xxx ", $ connection ) ;
$ selezionedati = "SELECT * FROM photos ORDER BY ID DESC LIMIT 20" ;
$ query = mysql_query ($ selezionedati ) or die ( mysql_error ());

header (" Content-type: text / xml ");

echo (" <rss version=\"2.0\"> ");
echo (" <channel> ");
echo (" <title> People </ title >") ;
echo (" <link> http://espanici/archivio.php </ link >") ;
echo (" <description> people < / description> ");
echo " <copyright> Copyright 2013 < / copyright > \ n";
echo " <docs> http://espanici < / docs > \ n";
echo " <managingEditor> espanici ( emanuele ) </ managingEditor > \ n";
echo " <webMaster> espanici.com ( emanuele ) </ webMaster > \ n";
echo (" <language> IT- en </ language >") ;
while ($ array = mysql_fetch_array ( $ query )) {
extract ( $ array ) ;
echo " <item>
<title> $ name </ title>
<link> http://espanici/tabella.php?id = $ id </ link>
<description> $ name < / description>
<image>
<link> http://espanici/tabella.php?id = $ id / </ link>
<url> http://espanici/ $ location < / url >
<title> $ name </ title>
</ image>
</ item > " ;
}
echo " < / channel > </ rss >" ;
? >

通知插入工作。当我点击链接打开确切的卡片,但我想插入照片。我使用的代码指的是照片的正确链接,但应用程序没有看到它。 这是页面http://espanici.altervista.org/antonio/fedd.php这是网址

其中$ location是图片的路径

1 个答案:

答案 0 :(得分:0)

我通过输入以下代码解决了这个问题。

<description><![CDATA[<img src=\"http://espanici/$location\" width=\"57\" height=\"57\" />]]></description>