当前位置:Gxlcms > PHP教程 > ()一个phptelnet的有关问题

()一个phptelnet的有关问题

时间:2021-07-01 10:21:17 帮助过:2人阅读

(在线等)求助一个php telnet的问题
前几天看了网上一个牛人写的php telnet的源码


/**
* name:薛如飞
* qq:6706250
* e-mail:xuerufei@163.com
* blog:http://hi.baidu.com/飞云盖天
* date:08.08.28
**/
if (isset($_POST['host']) and isset($_POST['user']))
{
$host= $_POST['host'];
$user= $_POST['user'];
$pass= $_POST['pass'];
$cmd= stripslashes($_POST['cmd']);
require_once "phptelnet.php";
$telnet = new PHPTelnet();
$telnet->show_connect_error=0;
$result = $telnet->Connect($host,$user,$pass);
switch ($result)
{
case 0:
$telnet->DoCommand($cmd, $result);
echo $result;
$telnet->Disconnect();
break;
case 1:
echo '[PHP Telnet] Connect failed: Unable to open network connection';
break;
case 2:
echo '[PHP Telnet] Connect failed: Unknown host';
break;
case 3:
echo '[PHP Telnet] Connect failed: Login failed';
break;
case 4:
echo '[PHP Telnet] Connect failed: Your PHP version does not support PHP Telnet';
break;
}
}
else
{
?>


}
?>

/*
PHPTelnet 1.1

人气教程排行