Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

createacct() package name problem

Discussion in 'General Discussion' started by testvto, Feb 2, 2009.

  1. testvto

    testvto Member

    Joined:
    Jan 28, 2009
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    51
    Hi,
    i do have a problem while creating account using createacct() function.
    I do have a package called "Package 6".When i create account using this package the created account list shows only "Package".

    code is, createacct($host,$user,$accesshash,1,$domain_name,$cpanel_username,$cpanel_password,"Package 6",'testvto@gmail.com');

    That is the space coming between "Package" and "6" is skipping.

    Please help me to recover this issue.
     
  2. cPanelKenneth

    cPanelKenneth cPanel Development
    Staff Member

    Joined:
    Apr 7, 2006
    Messages:
    4,563
    Likes Received:
    42
    Trophy Points:
    308
    cPanel Access Level:
    Root Administrator
    Please outline the steps, in detail, you are taking to create the account. Please indicate the full version of cPanel in use.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. testvto

    testvto Member

    Joined:
    Jan 28, 2009
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    51
    Thanks for your reply.

    cPanel Version is 11.24.4-RELEASE.

    I am giving the test script am using for creating an account.

    <?php


    //CREATE CPANEL ACCOUNT
    require 'php/Accounting.php.inc';
    $host = "localhost";
    $user = "root";
    $accesshash = 'WHM Remote Access Key is given in this palce ';

    $cpanel_username="chct130";
    $cpanel_password="abcd1231";
    $domain_name="chcchnet130Feb3.com";


    $accts = createacct ($host,$user,$accesshash,1,$domain_name,$cpanel_username,$cpanel_password,"Package 6",'testvto@gmail.com');


    echo " BELOW PRINT THE STATUS OF ACCOUNT CREATION";
    echo '<pre>';
    echo $accts;
    echo '</pre>';

    ?>


    Account is getting created but the package name which i have given not coming fully.Instead of "Package 6" only "Package" is coming under the account details.

    The craeteacct() function from Accounting.php.inc is giving below,

    function createacct ($host,$user,$accesshash,$usessl,$acctdomain,$acctuser,$acctpass,$acctplan,$useremail="") {
    if($useremail=="")
    {

    $result = whmreq("/scripts/wwwacct?remote=1&nohtml=1&username=${acctuser}&password=${acctpass}&domain=${acctdomain}&plan=$acctplan",$host,$user,$accesshash,$usessl);
    }
    else
    {

    $result = whmreq("/scripts/wwwacct?remote=1&nohtml=1&username=${acctuser}&password=${acctpass}&domain=${acctdomain}&plan=$acctplan&contactemail=${useremail}",$host,$user,$accesshash,$usessl);
    }
    if ($cpanelaccterr != "") { return; }
    return $result;
    }
     
    #3 testvto, Feb 2, 2009
    Last edited: Feb 3, 2009
  4. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Joined:
    Nov 29, 2006
    Messages:
    11,216
    Likes Received:
    10
    Trophy Points:
    313
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Personally, I'm a fan of our newer XML API as it offers much more functionality: http://www.cPanel.net/plugins/xmlapi

    Have you tried using Package%206 (note the URL encoding) as a package name in your script?
     
  5. testvto

    testvto Member

    Joined:
    Jan 28, 2009
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    51
    Thank you very much for your help.:)

    I have tried the php function urlencode().The idea is got from you.
     
    #5 testvto, Feb 3, 2009
    Last edited: Feb 3, 2009
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice