homepage Welcome to WebmasterWorld Guest from 184.73.104.82
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / RSS, ATOM, and Related Technologies
Forum Library, Charter, Moderators: bill & werty

RSS, ATOM, and Related Technologies Forum

    
Valid Rss 2.0 but not showing in address bar
Need some help with PHP rss not showing in address bar
emacksey

5+ Year Member



 
Msg#: 3312208 posted 8:01 am on Apr 16, 2007 (gmt 0)

Hey all,

I'm having some problems showing Rss in my address bar for my site.

The Rss is validated and is at www.example.com/test.php

I just want to show the icon in the address bar that show we have rss for our latest pictures and news.

What am i missing?

Thanks for the help. Ehrin

Oh yeah my PHP is:

<?
include( "database.php" );

$photoLimit =40;

$gallery_result = mysql_query("SELECT * FROM photo_galleries where pub_pri = '0'", $db);
$gallery_rows = mysql_num_rows($gallery_result);
while($gallery = mysql_fetch_object($gallery_result)){
$approved_cats[] = $gallery->id;
}

$approved_cats = implode(", ", $approved_cats);

$package_result = mysql_query("SELECT * FROM photo_package where active = '1' and gallery_id IN ($approved_cats) order by 'id' desc LIMIT $photoLimit", $db);
$package_rows = mysql_num_rows($package_result);

header('Content-type: text/xml;');
echo "xml version=\"1.0\" encoding=\"utf-8\"\n\n";
echo"<rss version=\"2.0\">";
echo"<channel>";
echo"<title>example.com's Newest photos RSS</title>";
echo"<link>http://www.example.com/index.php</link>";
echo"<description>Latest 40 images from example.com</description>";

while($package = mysql_fetch_object($package_result)){

$photo_result = mysql_query("SELECT * FROM uploaded_images where reference = 'photo_package' and reference_id = '$package->id'", $db);
$photo_rows = mysql_num_rows($photo_result);
$photo = mysql_fetch_object($photo_result);

$ptgm_result = mysql_query("SELECT * FROM photographers where id = '$package->photographer'", $db);
$ptgm_rows = mysql_num_rows($ptgm_result);
$ptgm = mysql_fetch_object($ptgm_result);

?>


<item>
<author>support@example.com</author>
<guid isPermaLink="true">http://www.example.com/details.php?gid=<?=$_GET['gid'];?>&amp;sgid=<?=$_GET['sgid'];?>&amp;pid=<?=$package->id;?></guid>
<title>Photo Title: &quot;<?=$package->title;?>&quot; By: <?=$ptgm->name;?></title>
<link>http://www.example.com/details.php?gid=<?=$_GET['gid'];?>&amp;sgid=<?=$_GET['sgid'];?>&amp;pid=<?=$package->id;?></link>
<description>Description: <?=$package->description;?></description>
</item>

<!-- <image>
<url>http://www.example.com/image.php?src=<?=$package->id;?></url>
<title>http://www.example.com/details.php?gid=<?=$_GET['gid'];?>&amp;sgid=<?=$_GET['sgid'];?>&amp;pid=<?=$package->description;?></title>
<link>http://www.example.com/details.php?gid=<?=$_GET['gid'];?>&amp;sgid=<?=$_GET['sgid'];?>&amp;pid=<?=$package->id;?></link>
</image> -->
<?
}
?>
</channel>
</rss>

[edited by: bill at 8:09 am (utc) on April 16, 2007]
[edit reason] Removed site specifics - Use example.com [/edit]

 

bill

WebmasterWorld Administrator bill us a WebmasterWorld Top Contributor of All Time 10+ Year Member



 
Msg#: 3312208 posted 8:23 am on Apr 16, 2007 (gmt 0)

Welcome to WebmasterWorld emacksey.

Generally to get the browser to see that you have a feed you need to have something like the following being returned in the <head> of your HTML or PHP page:

<link rel="alternate" type="application/atom+xml" title="Atom" href="http://example.com/atom.xml" />
<link rel="alternate" type="application/rss+xml" title="RSS 1.0" href="http://example.com/index.rdf" />
<link rel="alternate" type="application/rss+xml" title="RSS 2.0" href="http://example.com/index.xml" />

You don't have to have all of these (These are for an XHTML document.), but at least one would indicate to a modern browser that there's a feed available. Different browsers indicate feed availability differently though. (Not always in the Address Bar.)

emacksey

5+ Year Member



 
Msg#: 3312208 posted 10:30 am on Apr 16, 2007 (gmt 0)

Thank you very much for answering this for me. I have been trying tho figure this out for some time.

Also thanks for clearing out my site names. I must have had a relapse in thought when I posted that.

Thanks again,
Ehrin

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / RSS, ATOM, and Related Technologies
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved