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.

Adding account via PHP

Discussion in 'cPanel Developers' started by ExtremeH, Sep 4, 2004.

  1. ExtremeH

    ExtremeH Registered

    Joined:
    Sep 4, 2004
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

    I am trying to add an account via php but it never gets added?

    <?php
    include("inc/dbconnect.php");
    include("/usr/local/cpanel/Cpanel/Accounting.php.inc");
    {
    $str1A = mysql_query("SELECT name FROM clients WHERE clientid = $id",$db) or die('ERROR: ' . mysql_error());
    $str1B = mysql_result($str1A, 0);
    $str2A = mysql_query("SELECT password FROM clients WHERE clientid = $id",$db) or die('ERROR: ' . mysql_error());
    $str2B = mysql_result($str2A, 0);
    $str3A = mysql_query("SELECT domain FROM clients WHERE clientid = $id",$db) or die('ERROR: ' . mysql_error());
    $str3B = mysql_result($str3A, 0);
    $str4A = mysql_query("SELECT plan FROM clients WHERE clientid = $id",$db) or die('ERROR: ' . mysql_error());
    $str4B = mysql_result($str4A, 0);
    createacct ($whm_host,$whm_user,$whm_accesshash,$whm_ssl,$str3B,$str1B,$str2B,$str4B);
    echo "<p>Account $str1B now Active</p>";
    }
    include "inc/nav.inc";
    include "inc/footer.inc";
    ?>

    whm_host is "localhost"
    whm_user is "root"
    whm_accesshash is correct
    whm_ssl is "0"

    str1b is "test"
    str2b is "temp123"
    str3b is "www.test.com"
    str4b is "Extreme Starter"
    the name of the plan on server is also "Extreme Starter"

    Any ideas have i done this wrong?
     
  2. ExtremeH

    ExtremeH Registered

    Joined:
    Sep 4, 2004
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    OK just got it to work is there a way i can pass the contact email onto it to?
     
Loading...

Share This Page