Jump to content

Checking whether an RSS feed is read by or visited in the browser


Vinze

Recommended Posts

Hey, I got a page with an RSS feed generated by PHP. However, I want the page to show the contents of the feed when just visited in the browser, formatted as HTML. To do this, I need to be able to differentiate between the page being read as an RSS feed or being shown in the browser. Any ideas on how to do that?

Thanks in advance.

[quote]$_SERVER['HTTP_USER_AGENT'] does not work, as the RSS feed might be read by Firefox or another browser with RSS capabilities.[/quote]
[quote author=SemiApocalyptic link=topic=102457.msg406778#msg406778 date=1154380587]
You could check the user agent with $_SERVER['HTTP_USER_AGENT']
[/quote]

But why should user agent be different, I mean, the program used to access the page is still the same..
Sorry, I think I must have misunderstood you. I thought the feed would either be viewed with a browser, or with an RSS aggregator, and the feed would be formatted differently depending on what it was being viewed in. My bad.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.