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] Quote Link to comment 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'] Quote Link to comment 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.. Quote Link to comment 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. Quote Link to comment 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.