Subdomains

beetle

Verified User
Joined
Nov 19, 2003
Messages
26
Location
nethetlands
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??
 
Hello,

To help troubleshoot this, you might want to consider adding the following to the end of your code:

print_r($Socket);

That will dump the members of the HTTPSocket object to STDOUT and hopefully give you a hint to what might be going wrong.

Cheers, Phil.
 
Back
Top