Welcome to WebmasterWorld Guest from

Forum Moderators: bill & werty

Message Too Old, No Replies

Valid Rss 2.0 but not showing in address bar

Need some help with PHP rss not showing in address bar

8:01 am on Apr 16, 2007 (gmt 0)

New User

10+ Year Member

joined:Apr 16, 2007
votes: 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"<title>example.com's Newest photos RSS</title>";
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);


<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>
<description>Description: <?=$package->description;?></description>

<!-- <image>
</image> -->

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

8:23 am on Apr 16, 2007 (gmt 0)

Administrator from JP 

WebmasterWorld Administrator bill is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:Oct 12, 2000
votes: 142

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.)

10:30 am on Apr 16, 2007 (gmt 0)

New User

10+ Year Member

joined:Apr 16, 2007
votes: 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,