By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
438,747 Members | 2,011 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 438,747 IT Pros & Developers. It's quick & easy.

sending username and password with hostname in socket programming with php

P: n/a
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

Feb 19 '07 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.