Vinze Posted July 31, 2006 Share Posted July 31, 2006 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] Link to comment https://forums.phpfreaks.com/topic/16119-checking-whether-an-rss-feed-is-read-by-or-visited-in-the-browser/ Share on other sites More sharing options...
zq29 Posted July 31, 2006 Share Posted July 31, 2006 You could check the user agent with $_SERVER['HTTP_USER_AGENT'] Link to comment https://forums.phpfreaks.com/topic/16119-checking-whether-an-rss-feed-is-read-by-or-visited-in-the-browser/#findComment-66640 Share on other sites More sharing options...
Vinze Posted August 1, 2006 Author Share Posted August 1, 2006 [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.. Link to comment https://forums.phpfreaks.com/topic/16119-checking-whether-an-rss-feed-is-read-by-or-visited-in-the-browser/#findComment-66878 Share on other sites More sharing options...
zq29 Posted August 1, 2006 Share Posted August 1, 2006 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. Link to comment https://forums.phpfreaks.com/topic/16119-checking-whether-an-rss-feed-is-read-by-or-visited-in-the-browser/#findComment-66885 Share on other sites More sharing options...
Vinze Posted August 1, 2006 Author Share Posted August 1, 2006 Oh yes of course, RSS aggregator is also possible, but as Firefox has Live bookmarks and RSS extensions $_SERVER['HTTP_USER_AGENT'] would be of no use. Link to comment https://forums.phpfreaks.com/topic/16119-checking-whether-an-rss-feed-is-read-by-or-visited-in-the-browser/#findComment-66887 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.