automatic cpanel account creation with php


Aug 17, 2005
hi everyone,
Ive just recently signed up for a reseller account, that came with WHM. My host gave whmautopilot away for free, So I tried that, hated it and decided to create new accounts via php instead. Ive finished reading Cpanels accounting php module, and it wasnt very easy to understand( huge understatement).

What I want to do (create accounts) I understood to be something like this--

require '/usr/local/cpanel/Cpanel/';
$host = "localhost";
$user = "me";
$accesshash = '';

if ($newaccount=createacct ($host,$user,$accesshash,$usessl,$acctdomain,$acctuser,$acctpass,$acctplan))
{ print "new account created";}

however Ive read some posts saying that for createacct the variables are not in the correct order. Also that $acctuser cant have numbers in it etc.

Does accesshash stand for that really long whm key? Can someone walk me through the variables, telling me what each one stands for? and any limitations etc, and most importantly the correct format eg. for $acctdomain is it or just thanks for your help! :D