beetle
Verified User
i try to make a script for subdomains
--------------------------------------------------------
<?php
$subdomain = $_POST[subdomain];
include '../config/config.php';
include '../protocol/httpsocket.php';
$Socket = new HTTPSocket;
$Socket->connect($siteurl,$siteport);
$Socket->set_login($adminusername,$adminpassword);
$Socket->query('/CMD_API_SUBDOMAINS',
array(
'subdomain' => $subname,
'action' => 'create'
));
$result = $Socket->fetch_parsed_body();
if ( $Socket->get_status_code() != 200 || !empty($result['error']) )
{
// failure.
echo "Failed to add new subdomain: {$result['text']}<br />{$result['details']}";
} else {
// new user added.
print_r('User '.$subdomainname.' created...');
}
?>
----------------------------------
this what i get, but it gives me only the message: Failed to add new subdomain
what can are i doing wrong??
--------------------------------------------------------
<?php
$subdomain = $_POST[subdomain];
include '../config/config.php';
include '../protocol/httpsocket.php';
$Socket = new HTTPSocket;
$Socket->connect($siteurl,$siteport);
$Socket->set_login($adminusername,$adminpassword);
$Socket->query('/CMD_API_SUBDOMAINS',
array(
'subdomain' => $subname,
'action' => 'create'
));
$result = $Socket->fetch_parsed_body();
if ( $Socket->get_status_code() != 200 || !empty($result['error']) )
{
// failure.
echo "Failed to add new subdomain: {$result['text']}<br />{$result['details']}";
} else {
// new user added.
print_r('User '.$subdomainname.' created...');
}
?>
----------------------------------
this what i get, but it gives me only the message: Failed to add new subdomain
what can are i doing wrong??