Hi,
I'm trying to remove a subdomain from a domain through the API, but this does not work. I always get an error, but subdomain is still deleted.
This is my code:
If get the following errors:
On line 278 is:
And on line 406 is:
I cannot find the issue on Google or on any other forum. So maybe someone here can help me?
Thanks in advance
I'm trying to remove a subdomain from a domain through the API, but this does not work. I always get an error, but subdomain is still deleted.
This is my code:
PHP:
$socket = new HTTPSocket();
$socket->connect("*DOMAIN.com*, 2222);
$socket->set_login("*username*", "*password*");
$socket->set_method('POST');
$query = array(
'domain' => "*DOMAIN.com*",
'action' => "delete",
'select0' => "*name_subdomain*",
'contents' => "yes"
);
$socket->query('/CMD_API_SUBDOMAINS', $query);
$result = $socket->fetch_parsed_body();
If get the following errors:
Code:
Notice: Undefined offset: 1 in PATH\TO\httpsocket.php on line 278
Notice: Undefined offset: 1 in PATH\TO\httpsocket.php on line 406
On line 278 is:
Code:
list($this->result_header,$this->result_body) = preg_split("/\r\n\r\n/",$this->result,2);
And on line 406 is:
Code:
list($key,$value) = preg_split("/: /",$pair,2);
I cannot find the issue on Google or on any other forum. So maybe someone here can help me?
Thanks in advance