1
我試圖保存用戶郵寄的PHP黑猩猩的紀錄,但我得到這個錯誤,我不明白:訂閱在PHP
的fsockopen():php_network_getaddresses:的getaddrinfo失敗:沒有這樣的主機是已知的。
我使用MCAPI類版本1.3
這裏是我的代碼保存:
$apikey='d9750fc48519551e22e789c1gthy050a5-fd7'; // Enter your API key
$api = new MCAPI($apikey);
$retval = $api->lists();
$listid='d395e7afr4'; // Enter list Id here
$fname = $this->stepdata['yourName'];
$lname = $this->stepdata['yourName'];
$email = $this->stepdata['yourEmail'];
// By default this sends a confirmation email - you will not see new members
// until the link contained in it is clicked!
$merge_vars = array('FNAME' => $fname, 'LNAME' => $lname, 'EMAIL' => $email);
//listSubscribe'=>array("id","email_address","merge_vars","email_type","double_optin","update_existing","replace_interests","send_welcome")
if($api->listSubscribe($listid, $email, $merge_vars, $email_type='html', $double_optin=false, $update_existing=false, $replace_interests=false, $send_welcome=true) === true) {
}
這是錯誤的,在上MCAPI類
ob_start();
if ($this->secure){
$sock = fsockopen("ssl://".$host, 443, $errno, $errstr, 30);
} else {
$sock = fsockopen($host, 80, $errno, $errstr, 30);
}
謝謝指點
請檢查這兩個鏈接: - http://stackoverflow.com/questions/8210099/php-php-network-getaddresses-getaddrinfo-failed-no-such-host-is-known。 http://stackoverflow.com/questions/2661546/php-network-getaddresses-getaddrinfo-failed-name-or-service-not-known – 2015-03-30 19:48:12
如果這是您真正的API密鑰,您可能希望將其從代碼示例中刪除,併爲安全,生成一個新的。 – Shervin 2015-03-30 21:03:51
@謝爾文沒有它不是我真正的API密鑰感謝您的建議:) – 2015-03-31 06:34:05