On 17 Jul, 21:13, Gilles Ganault <nos...@nospam.comwrote:
Hello
I have a PHP script rss.php that serves RSS to clients. It
work fine, but I'd like to server customized contents, and for this, I
need to know who the user is.
Unless there's a better way, it looks like the easiest way is to use
HTTP basic authentication:
http://en.wikipedia.org/wiki/Basic_a...ication_scheme
So I figure I should have a section in the script that starts with
prompts for a login/passwd, then fetch contents with a customized
SELECT, and format it as RSS before sending the output to the RSS
client.
Has someone written this before and could share some tips/code?
Thank you.
Alternatively you could drop a cookie from a page which handles the
input of personalization details and pick it up in your script.
Both this and the HTTP authentication approach have a fundamental flaw
though - it may not be the users browser which access the RSS feed -
there may be an intermediate rendering agent doing the fetch on their
behalf - some may be happy to retain and pass on HTTP auth stuff but I
wouldn't count on it.
A more flexible solution might be to add additional paramters with the
RSS URL....
http://example.com/rss.php?user=gilles
(my igoogle page has a horoscope on it where I can configure my star
sign - but there's something more than just RSS going on here - as far
as I can tell, it goes beyond the scope of Atom too)
HTH
C.