Current location: Hot Scripts Forums » Programming Languages » PHP » how to add images in rss feeds


how to add images in rss feeds

Reply
  #1 (permalink)  
Old 04-03-08, 06:21 AM
macintosh macintosh is offline
Newbie Coder
 
Join Date: Mar 2007
Posts: 84
Thanks: 1
Thanked 0 Times in 0 Posts
how to add images in rss feeds

I want to create rss feed and display the images thumbs in it.. I could not find out how i can add images in rss feeds.
thanks.
following is my code..

PHP Code:

<? header('Content-type: text/xml'); ?>

<?php
include "config.php";
?> 
<rss version="2.0">
<channel>
<title>Test Title</title>
<description>This is an example description</description>
<link>http://pixel2life.com</link>
<?
$sql 
"SELECT * FROM images limit 15";
$result mysql_query($sql);
while(
$row mysql_fetch_assoc($result)){
?>
<item>
     <title><?=$row['title']; ?></title>
//I want to add image here. the image path is <?=$row['path']; ?>
     <author><?=$row['name']; ?></author>
     <link>news.php?id=<?=$row['id']; ?></link>
    </item>
<?
}
?>
</channel>
</rss>
Reply With Quote
  #2 (permalink)  
Old 04-03-08, 02:03 PM
phpdoctor's Avatar
phpdoctor phpdoctor is offline
Code Guru
 
Join Date: Feb 2007
Location: New Zealand
Posts: 767
Thanks: 4
Thanked 2 Times in 2 Posts
This is how i do it:
Code:
<image> 
              <title>Hello World</title> 
              <url>images/logo_rss.gif</url> 
              <link>http://www.somesite.com</link> 
    </image>
Hope that helps,
Lex
__________________
01010000 01001000 01010000
Reply With Quote
Reply

Bookmarks


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
New RSS and Podcast Creation Software with iTunes Support notepage General Advertisements 0 01-17-07 05:31 AM
Combine RSS Feeds on wmy website? dinalsi Script Requests 0 04-04-06 07:52 AM
perl dates (for rss feed) gnznroses Perl 4 11-28-05 01:44 PM
Search and capture RSS feeds automatically ranjani Perl 1 08-26-04 11:47 PM


All times are GMT -5. The time now is 07:40 AM.
vBulletin® Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.