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.

Accounting.php

Discussion in 'General Discussion' started by gic, Feb 25, 2003.

  1. gic

    gic Well-Known Member

    Joined:
    Jun 28, 2002
    Messages:
    69
    Likes Received:
    0
    Trophy Points:
    6
    If you use this, what does it return? How would I write the following in php.

    Create an account and if the account creation failed, tell the uesr what happened. Otherwise, continue to another page (named page2.php). Thanks
     
  2. jimcarter

    jimcarter Well-Known Member

    Joined:
    Jun 30, 2002
    Messages:
    152
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    UK
    Hi,
    PHP:
    require '/usr/local/cpanel/Cpanel/Accounting.php.inc';
        
    $host "localhost";
        
    $user "user";
        
    $accesshash 'ACCESSHASH';    
        
    $usessl "1";
    $do createacct($host,$user,$accesshash,$usessl,$acctdomain,$acctuser,$acctpass,$acctplan);
    if (!
    eregi("wwwacct creation finished",$do)){ 
    echo 
    "There has been a problem with your account creation!<br>Please contact support for help!";
    }
    else
    {
    Header("Location: success.html");
    }
    hope this helps,
    Thanks
     
  3. gic

    gic Well-Known Member

    Joined:
    Jun 28, 2002
    Messages:
    69
    Likes Received:
    0
    Trophy Points:
    6
    And then just fill in the other info like username, acctplan, etc with those values and I'm set?
     
  4. jimcarter

    jimcarter Well-Known Member

    Joined:
    Jun 30, 2002
    Messages:
    152
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    UK
    Yep,
    the only other values you need are:
    $acctdomain
    $acctuser
    $acctpass
    $acctplan
    Thanks
     
  5. asmithjr

    asmithjr Well-Known Member

    Joined:
    Jun 13, 2003
    Messages:
    475
    Likes Received:
    1
    Trophy Points:
    18
    I get error with this one

    I am using the code you mention but I get:
    I checked my plan and it is right.

    The test script works to display the accounts so the login portion is working. Just not creating the account.

    cPanel.net Support Ticket Number:
     
  6. andyf

    andyf Well-Known Member

    Joined:
    Jan 7, 2002
    Messages:
    246
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    UK
    Re: I get error with this one

    Create an account manually in WHM and verify it is actually working.

    cPanel.net Support Ticket Number:
     
Loading...

Share This Page