You are here: Re: Handling HTTP basic authentication in script? « PHP Programming Language « IT news, forums, messages
Re: Handling HTTP basic authentication in script?

Posted by C. on 07/19/07 12:33

On 17 Jul, 21:13, Gilles Ganault <nos...@nospam.com> wrote:
> 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_authentication_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.

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация