Page 1 of 1

Send authenticate

Posted: Wed Aug 30, 2006 4:57 am
by totillas
Hi grugru,

I develop a console application what will connect to a webserver and get data from there. Console application run ondemand like a service. Webserver is configed Basic Authentication. I have username and password.

Does anyone know how can console application passes user/password to webserver?

Thanks in advanced.

Posted: Wed Aug 30, 2006 6:24 am
by Supper Baby
how do you connect to the remote server ?

you may use

Code: Select all

$fp = fsockopen("domain.com", 2043, $errno, $errstr, 30);
fputs($fp, 'username' );

Posted: Wed Aug 30, 2006 7:58 pm
by totillas
Normally, I can connect to webserver using browser. It shows authentication dialog, inputs username/password here. But the console application can not do like that. Is there any way to send username/password to server for authenticating and then get needed data?

Posted: Wed Aug 30, 2006 8:02 pm
by feyd

Posted: Wed Aug 30, 2006 9:04 pm
by totillas
Yes, it is. Thanks