Home  >  Article  >  Backend Development  >  ()一个php telnet的有关问题

()一个php telnet的有关问题

WBOY
WBOYOriginal
2016-06-13 12:56:02834browse

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

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

   

   


   

Telnet


   
  
    
    
  
  
    
    
  
  
    
    
  
  
    
    
  
  
    
    
  
   
host:
user:
pass:
cmd:
          
 

   

 



   }
?>
 
/*
PHPTelnet 1.1
Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn