Php Whcms域whois API不';行不通

Php Whcms域whois API不';行不通,php,content-management-system,dns,whois,Php,Content Management System,Dns,Whois,这是我的代码: <?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;

这是我的代码:

<?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)“结果=错误;消息=无效IP 89.24.47.30;”

我做错了什么?

找到了解决方案

进入管理面板,常规设置->安全并添加ip地址