php - fsockopen PHP检查RDP的打开端口不起作用

标签 php mysql fsockopen

它不检查RDP的端口= 3389,对于ftp是,Web是,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>";
    }

最佳答案

似乎脚本正在尝试连接到“ RDP IP”,而不是使用服务器变量。

关于php - fsockopen PHP检查RDP的打开端口不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42227922/

相关文章:

javascript - 客户端和服务器端编程有什么区别?

php - 在配置文件选项卡中添加列结构(如网格)

python - 如何使用不同的 python 服务将数据库从 MySQL 复制到另一个数据库,确保一行只复制一次?

php - 无法通过 fsockopen 在 PHP 中建立 TLS 连接

php - 如何在代理后面使用带有 fsockopen 的 imap

PHP fsockopen()/fread() 返回困惑的数据

php - Laravel belongsToMany 与 OR 条件

php - 使用 PHP Curl 提交表单并获取结果

带有jdbc池的grails 2.2.4中处于等待状态的MySQL语句取消计时器

php - 通过假设表 MySQL/PHP 中的列来设置值