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.

createacct function returns varied results

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

  1. simonlee

    simonlee Active Member

    Joined:
    Jan 19, 2003
    Messages:
    37
    Likes Received:
    0
    Trophy Points:
    6
    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);
    srand(make_seed());
    $addon = rand(0,999); //if username exists in Cpanel
    echo "<br>$round: <br>";
    echo $result;
    $round++;
    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!';
    break;
    }
    }
    --------------------------------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?
     
Loading...

Share This Page