这个类哪错了…第一次写类

@Ta 2014-02-06 1785点击
@老虎会游泳
YH没CURL,我买的空间还没开错误提示…所以…
调用页面代码:
<?php
error_reporting(E_ALL&~E_DEPRECATED&~E_NOTICE);
include "confid.php";
include "dnspod.class.php";
$cs=new dnspod();
var_dump($cs);  //执行完这里,后面就没有了
$cs->dns_cx(); 
var_dump($cs);

类:
<?php
class dnspod{
protected $api_addr;
protected $api_data=array();
public $result;
function __construct(){
$this->api_data["login_email"]=LOGIN_EMAIL;
$this->api_data["login_password"]=LOGIN_PASSWORD;
$this->api_data["format"]="json";
$this->api_data["lang"]="zh";
$this->api_data["error_on_empty"]="no";
}
protected function dns_curl(){
$ch=curl_init();
curl_setopt($ch,CURLOPT_URL,"https://dnsapi.cn/".$this->api_addr);
curl_setopt($ch,"CURLOPT_POST",1);
curl_setopt($ch,"CURLOPT_POSTFIELDS",http_build_query($this->api_data));
curl_setopt($ch,"CURLOPT_USERAGENT",POST_UA);
curl_setopt($ch,CURLOPT_HEADER,0);
curl_setopt($ch,CURLOPT_RETURNTRANSFER,1);
curl_setopt($ch,CURLOPT_SSL_VERIFYPEER,0);
curl_setopt($ch,CURLOPT_SSL_VERIFYHOST,0);
$result=curl_exce($ch);
curl_close($ch);
return $result;
}
function dns_cx(){
$this->api_addr="Domain.Create";
$this->api_data["domain_id"]=DOMAIN_ID;
$this->result=$this->dns_curl();
}
}
?>
回复列表(4|显示机器人聊天)
添加新回复
回复需要登录