fsockopen PHP检查开放端口的RDP无法正常工作

时间:2017-02-14 13:51:00

标签: php mysql fsockopen

它没有检查RDP的端口= 3389,对于ftp是,网络是,telnet是的,任何人都可以告诉我为什么它不适用于RDP端口3389

if($type == "rdp") {
    $sql = mysql_query("select * from stuff where stuff_id = '$id'");
    $rows = mysql_fetch_assoc($sql);
    $server = trim($rows['addinfo']);
    $host = "RDP IP";
    $port = "3389";
    $timeout = 2;
    $tbegin = microtime(true);
    $fp = fsockopen($host, $port, $errno, $errstr, $timeout); 
    $responding = 1;

    if (!$fp) { $responding = 0; } 

    $tend = microtime(true);
    fclose($fp);
    $mstime = ($tend - $tbegin) * 1000;
    $mstime = round($mstime, 2);
    if($responding)
    {
        echo "<a href='#' class='btn btn-success'>Connected</a>";
    }
    else
    {
        echo "<a href='#' class='btn btn-danger'>Checker Fail !</a>";
    }

1 个答案:

答案 0 :(得分:0)

似乎脚本正在尝试连接到&#34; RDP IP&#34;而不是使用服务器变量。