function papaki_DeleteNameserver($params) { $username = ''; $password = ''; $apikey = encodetolatin($params["APIkey"]); $posturl = encodetolatin($params["PostUrl"]); $testmode = encodetolatin($params["TestMode"]); $tld = encodetolatin($params["tld"]); $sld = encodetolatin($params["sld"]); $nameserver = encodetolatin($params["nameserver"]); # Put your code to delete the nameserver here ######################## $json = new Services_JSON(); $jsonarray = array("request" => array("do" => 'deletens', "username" => $username, "password" => $password, "apiKey" => $apikey, "domainname" => $sld . "." . $tld, "registration_type" => '2', "test" => 'False', "ns" => $nameserver)); $Xpost = $json->encode($jsonarray); $Xpost = latintogreek($Xpost); $headers = array('Content-type: application/x-www-form-urlencoded'); $pageContents = HttpClient::quickPost($params["PostUrl"], array('message' => $Xpost)); $responsearray = $json->decode($pageContents); $codeNode = $responsearray->response->code; $message = $responsearray->response->message; // if ($codeNode!="1000" ){ // $values["error"]='Error: ' . $codeNode . ' - ' . $message; //} $values["error"] = 'Error: Not Supported'; ##################################### # If error, return the error message in the value below // $values["error"] = $error; return $values; }
function exec_request_for($type = _TYPE_DS, $use_get_extenssions_func = true) { $this->type = $type; //$exts=array('.'.$this->tld); $json = new Services_JSON(); $jsonarray = array("request" => array("type" => $type, "apiKey" => encodetolatin($this->apikey), "username" => '', "password" => '', "domain" => encodetolatin($this->domainName), "lang" => 'el', "test" => 'False', "extensions" => array("ext" => array('.' . $this->tld)))); if ($this->type == _TYPE_WHOIS) { $jsonarray = array("request" => array("type" => $type, "apiKey" => encodetolatin($this->apikey), "username" => '', "password" => '', "domain" => encodetolatin($this->domainName), "lang" => 'el', "test" => 'False')); } //print_r($jsonarray); $Xpost = $json->encode($jsonarray); $Xpost = latintogreek($Xpost); $headers = array('Content-type: application/x-www-form-urlencoded'); //print '<pre>'.$Xpost.'<br /><br />'.'</pre>'; $pageContents = HttpClient::quickPost($this->requestURL, array('message' => $Xpost)); //print '<pre>'.$pageContents.'<br /><br />'.'</pre>'; $this->responsearray = $json->decode($pageContents); //print_r($this->responsearray ); $this->parseResponse(); $this->domainName = $this->IDN->decode($this->domainName); }