(Online, etc.) for a phptelnet issue, I read the php & nbsp; telnet source code written by a cool online user a few days ago. & lt ;? Php/*** & nbsp; name: Xue Rufei * & nbsp; qq: 6706250 * & nbsp; e-mail: xuerufei@163.com * & nbsp; blog: & lt; a & nbsp; (online, etc.) ask for a php telnet problem
I read the php telnet source code written by a cool man on the Internet a few days ago.
/**
* Name: Xue Rufei
* Qq: 6706250
* E-mail: xuerufei@163.com
* Blog: http://hi.baidu.com/apsara stack
* 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
{
?>
}
?>
/*
PHP ptelnet 1.1