Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save rolltidehero/166943b6a103b88dda10459dd155185e to your computer and use it in GitHub Desktop.
Save rolltidehero/166943b6a103b88dda10459dd155185e to your computer and use it in GitHub Desktop.
Bulk Add Domains To DirectAdmin
<?php
/**
* Adding domains to DirectAdmin
*/
include 'httpsocket.php';
// domains comma seperated
$domains = 'domein1.nl,domein2.nl,domein3.nl';
$domains = explode(',',$domains);
foreach($domains as $domain){
$sock = new HTTPSocket;
$sock->connect('5.61.249.66',2222);
$sock->set_login("username","password");
$sock->set_method('POST');
$sock->query('/CMD_DOMAIN',
array(
'action' => 'create',
'domain' => $domain,
'ubandwidth' => 'unlimited',
'uquota' => 'unlimited',
'ssl' => 'ON',
'cgi' => 'ON',
'php' => 'ON',
'create' => 'Create'
));
$result = $sock->fetch_body();
echo $result;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment