The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

php remote access and WHM

Discussion in 'cPanel Developers' started by banpro, Nov 10, 2003.

  1. banpro

    banpro Registered

    Sep 30, 2003
    Likes Received:
    Trophy Points:
    Okay, we use a custom written Windows-based software package for our client/account management and organization. As it is, when new hosting account orders are placed on our site it grabs the submitted (signup) form information from our formatted email and places the new client's details into the appropriate fields. The new account is then verified (to prevent fraud) by someone here, then we have to login to WHM and actually create the account.

    What I'd like to do is, using a php script on our server, send the appropriate information to it (as if sent via a web based form) from our software, and have the php script create the account in WHM.

    I know this is possible, other management/billing programs do this already (modernbill and etc.). I can get everything up to the point where the variables for the php script are sent to it.

    What I need help with is the php script which will take the information and serve it to WHM in the proper format with a "createacct" command.

    I'm thinking something like this (based on WHM documentation) should work:
    require '/usr/local/cpanel/Cpanel/';
    $host = "localhost";
    $user = "<USERNAME>";
    $accesshash = '<REMOTE ACCESS KEY PASTED>';

    createacct ($host,$user,$accesshash,$usessl,$acctdomain,$acctuser,$acctpass,$acctplan);

    But before I attempt it I'd appreciate input or comments from anyone here regarding my method. I'd hate to send the wrong info or the right info in the wrong format and erase some vital files or information.

    Also, does anyone know if this would work the same regardless of whether it's for the root WHM account or a reseller's WHM account?


Share This Page