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]
Link to comment
Share on other sites

[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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.