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!

Result of user creation script

Discussion in 'cPanel Developers' started by angela zou, Jan 12, 2012.

  1. angela zou

    angela zou Member

    Dec 25, 2011
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Reseller Owner
    I'm running a user creation script that basically has the following structure:
      $script "http://{$whm_user}:{$whm_pass}@{$whm_host}:2086/scripts/wwwacct";
    $params "?plan={$result->user_plan}&domain={$result->user_domain}&username={$result->user_name}&password={$result->user_pass}&contactemail={$result->user_email}";
    $result file_get_contents($script.$params);
    I don't want the script to output anything unless there is an error (when it's successful, it's redirected to another page). So, I need to test the success of file_get_contents($script.$params). So, what is the output of $result when it is and is not successful?

  2. cPanelDavidG

    cPanelDavidG Technical Product Specialist

    Nov 29, 2006
    Likes Received:
    Trophy Points:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    That script is incompatible with contemporary versions of cPanel&WHM, especially servers where CSRF protection is enabled. I would advise you use our APIs rather than something like that which calls a URL directly and thus sends your username and password in plain text (a very bad idea).

    I assume you're programming in PHP. You can download a PHP class which includes a call to creating an account as part of its examples, this can be downloaded from:

    Details of the output returned by this function is posted in our SDK documentation at: CreateAccount < SoftwareDevelopmentKit < TWiki

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