Created
July 14, 2015 19:47
-
-
Save nickkuijpers/1b74118796af7c81ae96 to your computer and use it in GitHub Desktop.
Bulk Add Domains To DirectAdmin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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