Whcms 域名 whois API 不起作用

发布于 2024-09-25 15:25:09 字数 839 浏览 5 评论 0原文

这是我的代码:

<?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;"

我做错了什么?

So here is my code:

<?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));
?>

I get this: string(44) "result=error;message=Invalid IP 89.24.47.30;"

What I'm doing wrong?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

梦屿孤独相伴 2024-10-02 15:25:09

找到解决方案!

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

Solution Found!

Go into the admin panel, General Settings -> Security and add the ip address

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文