Forum Moderators: coopster

Message Too Old, No Replies

parse http user and password

parse http user and password in php's fopen

         

copongcopong

5:31 pm on Oct 29, 2003 (gmt 0)

10+ Year Member



in msie you can type http://user:pass@protectedsite.com ....

using php's "fopen" this would surely not work, my question is if it possible to automatically send the user and password to a url that ask for http authentication?

Thanks for any information on this.

[edited by: jatar_k at 5:41 pm (utc) on Oct. 29, 2003]
[edit reason] delinked example [/edit]

bcolflesh

5:36 pm on Oct 29, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm pretty sure I've used:

fopen("http://username:password...

in the past with no problems - are you getting an error?

copongcopong

6:01 pm on Oct 29, 2003 (gmt 0)

10+ Year Member



maybe it is webserver dependent..., are you using IIS (microsoft) or Apache? I have Apache at my end.

i even tried it in mozilla and it does not allow the user and password to be added in the url.

Thanks.

bcolflesh

6:04 pm on Oct 29, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I just tried it again - works fine on Apache 1.3x

coopster

6:12 pm on Oct 29, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



>>and it does not allow the user and password to be added in the url.

What errors are you receiving?

copongcopong

6:17 pm on Oct 29, 2003 (gmt 0)

10+ Year Member



it does not generate any error message, thanks for your reply ... i would try to do some test.