Deleting subdomain gives an error

jfrijhof

New member
Joined
Aug 18, 2013
Messages
1
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:
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
 
If its deleted then why does it matter. Just change your error reporting so you dont see notices.
 
Back
Top