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 function returns varied results

Discussion in 'General Discussion' started by simonlee, Apr 9, 2003.

  1. simonlee

    simonlee Active Member

    Jan 19, 2003
    Likes Received:
    Trophy Points:
    I am newbie and confused,
    I used createacct function in my php script:
    --------------------------------script begin----------------------------------
    $round = 0;
    $addon = '';
    while(!strstr($result,'New Account Info') && $round<4)
    $username_c = $username . $addon;
    $result = createacct ($whm_host,$whm_user,$whm_accesshash,0,$DomainName,$username_c,$passwd,$Package);
    $addon = rand(0,999); //if username exists in Cpanel
    echo "<br>$round: <br>";
    echo $result;
    if (strstr($result,'domain is already setup'))
    $ErrorCode = 'Sorry, this Domain Name is already setup on our server. Please use the Back Button on your Browser to go back to the previous page. Make sure the Domain name you entered is Correct. If you still have problems, Please contact us!';
    --------------------------------script end----------------------------------
    I put this script on a secure server, url begins with https://..., it's working well, everytime it returns '.........New Account Info..........'. But when I put this script on a none secure server, url begins with http://..., it doesn't work. and I got varied value of $result after the account created successfully in Cpanel.
    Sometime it's: '.........wwwacct creation finished......' (doesn't contain 'New Account Info')
    sometime it's: '.........New Account Info..........' (doesn't contain 'wwwacct creation finished')
    sometime it's: '' (NULL string)
    but the account created successfully all the time.

    What string should I catch for judge if the account has been setup successfully?

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