sending username and password with hostname in socket programming with php

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Dear All,

I am sending the code below.i have not specifies the host name.i want
to send command to server and get the response from it.but it doesnt
work.when i connect with the telnet using ssh to remote machine it

i type telnet hostname->username->password and then i can login to
remote can i send hostname with username and password to
remote machine in france


        $cmnd= "abc";
        $socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP) ;
    socket_connect($socket,$host,$port) ;

    socket_write($socket, $cmnd) ;

    $ser_messegeg=socket_read ($socket, 1024);
    echo $ser_messege;
    socket_close($socket) ;

Please help me


Site Timeline