Hi,
I have read a lot of forums and have tried many options that were suggested but none of them seems to work for me.
I am using fsockopen to telnet a host server. The connection seems to work however, fputs and fgets doesn't seem to work.
When I try to telnet the machine from the command line it works. It prompts for a password (no username) and then I can submit other commands.
Here is my code:
$fp=fsockopen($pshost, 23, $errno, $errstr, 30);
if (!$fp) {
echo "ERROR: $errno - $errstr<br />\n";
}
else
{
fputs($fp, "$pspasswd\r\n");
fputs($fp, "show all\r\n");
while(!feof($fp)) {
echo fgets($fp,512);
}
fclose($fp);
}
I simply get no output!
Any help will be appreciated.
Naureen