Re: @ character in http login
Available news archives: comp.lang.tcl - comp.lang.python - comp.security.firewalls - sci.crypt - comp.lang.php - comp.lang.javascript
Google
 
Web news.hping.org


comp.lang.php archive

Re: @ character in http login

From: <simonp@nospam.com>
Date: Sun Apr 23 2006 - 07:51:54 CEST

Michael B. Trausch <michael.trausch.no.spam@comcast.net> wrote:
> 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
>

Thank you for the pointer, it pointed me to the right solution.

It looks like &#64; is the escape character that works for @,
rather than %40. On using the parse_url() function on the url,
the correct email username was returned for the user element in
the resulting array.

Cheers
Simon

-- 
Stupendous Tales
www.stupendoustales.com
Speculative Fiction, Pulp Dreams
Received on Mon May 1 03:02:21 2006