\n"; $sock = new HTTPSocket; if ($server_ssl == 'Y') { $sock->connect("ssl://".$server_host, $server_port); } else { $sock->connect($server_host, $server_port); } $sock->set_login($server_login,$server_pass); $sock->query('/CMD_API_ACCOUNT_USER', array( 'action' => 'create', 'add' => 'Submit', 'username' => $username, 'email' => $email, 'passwd' => $pass, 'passwd2' => $pass, 'domain' => $domain, 'package' => $package, 'ip' => $server_ip, 'notify' => 'yes' )); $result = $sock->fetch_parsed_body(); if ($result['error'] != "0") { echo "Error Creating user $username on server $server_ip:
\n"; echo $result['text']."
\n"; echo $result['details']."
\n"; } else { echo "User $username created on server $server_ip
\n"; } exit(0); } echo "Will connect to: ".($server_ssl == "Y" ? "https" : "http")."://".$server_host.":".$server_port."
\n"; ?>
Username:
Domain:
Email:
Pass:
Packge:
**Note: do not use this php file exactly as it is. It's only to demonstrate the basics of the api. You *must* do form checking to ensure safe values are passed. Also, it's a really bad and very insecure practice to put a form like this publicly on your website for anyone to use. If you do, you'll end up with a server full users you did not create (this script creates accounts without any involvment with an admin: bad)