Hi all,

I'm trying to open a socket connection on a client. The server needs a 
username/password combination for this connection to accept. Does anybody know how to 
send this with php??

In ASP I use ................

"xmlhttp.Open "POST",sURL, false, sUser, sPass"

,where sUser=myUsername and sPass=myPassword. this script worx, but of course I want 
to use PHP :-)



in php i'm trying......... 

$hostname="https://www.url.com";;
$port=443;
$loginmessage="GET / HTTP/1.0\r\nHost: www.php.net\r\n\r\n";
$timeout=30;
$fp = fsockopen ($hostname, $port, $errno, $errstr, $timeout);
if (!$fp) {
    echo "$errstr ($errno)<br>\n";
} else {
    fputs ($fp, $loginmessage);
    while (!feof($fp)) {
        echo fgets ($fp,128);
    }
    fclose ($fp);
}


thx Wilbert




-------------------------
Pas de Deux
Van Mierisstraat 25
2526 NM Den Haag
tel 070 4450855
fax 070 4450852
http://www.pdd.nl
[EMAIL PROTECTED]
-------------------------

Reply via email to