Skip to content

Instantly share code, notes, and snippets.

@nickkuijpers
Created July 14, 2015 19:47
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save nickkuijpers/1b74118796af7c81ae96 to your computer and use it in GitHub Desktop.
Save nickkuijpers/1b74118796af7c81ae96 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