[英]Changing Email Passwords With cPanel XML API in PHP
我一直在慢跑着想如何讓我的用戶使用cPanels XML API更改密碼。 我已經用谷歌搜索過,玩過示例代碼,卻找不到任何可以遠程工作的東西。 有人可以告訴我我在做什么錯嗎? 謝謝!
require_once('../includes/xmlapi.php');
$ip = '127.0.0.1';
$root_pass = 'secret';
$account = 'accountna';
$email_account = $_POST['email'];
$email_domain = "mydomain.com";
$xmlapi = new xmlapi($ip);
$xmlapi->password_auth("root",$root_pass);
$xmlapi->set_debug(1);
$args = array(
'domain'=>$email_domain,
'email'=>$email_account
);
if ($xmlapi->api2_query($account, "Email", "passwdpop", array( 'domain' => "domain name", 'email' => "user name", 'password' => "new password") )) {
echo "Success!";
};
您要設置端口了! 在password_auth之前
$xmlapi->set_port ( 2083 );
$xmlapi->password_auth("root",$root_pass);
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.