dachshund Posted May 20, 2008 Share Posted May 20, 2008 Does anyone know how to use PHP to include an image in an RSS feed. Currently I'm using PHP to write my RSS feeds title, link, description etc, but i can't work out how to include an image like this: feed://www.itsnicethat.com/index.php?rss=1 My code so far is <?php header("Content-type: text/xml"); echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>"; echo "<rss version=\"2.0\">"; echo "<channel> <title></title> <description></description> <link></link>"; ?> <?php session_start(); $connect= mysql_connect ("", "", "") or die(mysql_error()); $db = mysql_select_db ("", $connect); $session_name = $_SESSION['uid']; ?> <? $data = mysql_query("SELECT * FROM entries ORDER BY id DESC LIMIT 10"); while($row = mysql_fetch_array($data)) echo "<item> <link>view_post.php?id=".$row['id']."</link> <guid isPermaLink=\"true\">view_post.php?id=".$row['id']."</guid> <title>".$row['title']."</title> <description><![CDATA[".$row['condensedpost']."]]></description> </item>"; echo "</channel> </rss>"; ?> obviously all the database connection fields are filled in, i've just taken them out for this post. Any help would be greatly appreciated. Cheers. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.