Create subdomain thru PHP

fritzelly

New member
Joined
May 8, 2020
Messages
6
I'm trying to create a new subdomain thru PHP but it's not working - the result of $result is
string(1100) "

"
I'm using httpsocket v 3.0.2 and the code to create the subdomain
Code:
include 'httpsocket.php';
$sock = new HTTPSocket;
$sock->connect('{mysite}',2222);
$sock->set_login("admin|user","{password}");
$sock->set_method('POST');
$sock->query('/CMD_API_SUBDOMAINS',
        array(
                'action' => 'create',
                'domain' => '{top_level_domain}',
                'subdomain' => 'test',
    ));
$result = $sock->fetch_body();
var_dump( $result);

Am I missing something in the implementation?
 
Back
Top