代码之家  ›  专栏  ›  技术社区  ›  Uffo

Whcms域whois API不工作

  •  -1
  • Uffo  · 技术社区  · 16 年前

    下面是我的代码:

    <?php
    
    $url = "http://www.site.com/whcms/includes/api.php"; # This is not the original url, just an exapmle
    $username = "user"; # Admin username goes here
    $password = "pass"; # Admin password goes here
    
    $postfields["username"] = $username;
    $postfields["password"] = md5($password);
    $postfields["action"] = "domainwhois"; #action performed by the API:Functions
    $postfields["domain"] = "whmcs.com";
    
    $ch = curl_init();
    curl_setopt($ch, CURLOPT_URL, $url);
    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_TIMEOUT, 100);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $postfields);
    $data = curl_exec($ch);
    curl_close($ch);
    
    echo(var_dump($data));
    ?>
    

    string(44) "result=error;message=Invalid IP 89.24.47.30;"

    我做错什么了?

    1 回复  |  直到 16 年前
        1
  •  0
  •   Uffo    16 年前

    找到解决方案!

    进入“管理”面板的“常规设置”—>安全性并添加ip地址

    推荐文章