Send authenticate

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
totillas
Forum Newbie
Posts: 3
Joined: Wed Aug 30, 2006 4:44 am

Send authenticate

Post 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.
Supper Baby
Forum Commoner
Posts: 27
Joined: Tue Aug 01, 2006 11:33 pm

Post 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' );
totillas
Forum Newbie
Posts: 3
Joined: Wed Aug 30, 2006 4:44 am

Post 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?
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

totillas
Forum Newbie
Posts: 3
Joined: Wed Aug 30, 2006 4:44 am

Post by totillas »

Yes, it is. Thanks
Post Reply