Well I've been searching around quiet a bit on here and google and have found basicly nothing. Here's what I would like to do. I have a Masterswitch setup that I need to connect to with telnet. Run a few commands then close the conneciton. I've looked at using fsockopen and have come up with this:
<?php
$fp = fsockopen ("server", 23, $errno, $errstr, 30);
if (!$fp) {
echo "$errstr ($errno)<br>\n";
} else {
echo fgets($fp, 26);
fputs($fp, "username\r\n");
fputs($fp, "password\r\n");
echo fgets($fp, 26);
}
fclose($fp);
?>
Am I going about this at the wrong angle? Thanks