You are here: Re: @ character in http login « PHP Programming Language « IT news, forums, messages
Re: @ character in http login

Posted by Michael B. Trausch on 04/23/06 06:06

simonp@nospam.com wrote in <e2eq70$2ht$1@reader1.panix.com> on Sat April 22
2006 22:53:

> I am trying to use the basic http://user:password@example.com
> form for authentication inside a script.
>
> My only problem is my username contains the @ character (its an
> email address). As result, the url seems to be parsing
> incorrectly.
>
> Has anyone found a way around this problem?
>
> Cheers
> Simon
>

Well, the way it usually works is:

http://user:pass@server/

You may be able to try this:

http://user%40sample.com:pass@server

And see if it works. 0x40 is the hex character code for '@', and URL
encoding works by using % and then the hex char reference (i.e., %20 for a
space, %40 for '@', and so forth).

If that doesn't work, then I don't know what else you could do to make it
work, at least, when authenticating using basic auth like that.

- Mike

 

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

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