get cpanel username
Hello
I am trying to create new db using php script which I have place in postwwwacct .
I am able to create db if I manually give username and password in php script. Its works perfect.
What I wanted to do is, this script will automatically select username for which I am creating cpanel account
I tried to use :: $cpuser = "'.$opts['user">.'";
However its not working
Please assist.
-
What I wanted to do is, this script will automatically select username for which I am create cpanel user
Hello, Could you elaborate a bit further on what you are attempting to configure? Thank you.0 -
Hello I used below script in postwwwacct .'"; $databasename = 'dbbb';//do not prepend with username $databaseuser = 'dbbb';//api will do that for you $databasepass = 'P3cJdlvx/vAo5cSRR5djAA=='; $xmlapi = new xmlapi($db_host); $xmlapi->password_auth("root","rootpass"); $xmlapi->set_debug(1);//this setting will put output into the error log in the directory that you are calling script from $xmlapi->set_output('array');//set this for browser output //create database $createdb = $xmlapi->api1_query($cpuser, "Mysql", "adddb", array($databasename)); foreach($createdb as $v) { $result = $v['result">; } if ($result == 1) { //create user $usr = $xmlapi->api1_query($cpuser, "Mysql", "adduser", array($databaseuser, $databasepass)); } foreach($usr as $v) { $result2 = $v['result">; } if ($result2 == 1) { //add user to database $addusr = $xmlapi->api1_query($cpuser, "Mysql", "adduserdb", array($databasename, $databaseuser, 'all')); } print_r($addusr); ?> 0 -
Bascially I want to install wordpress automatically if custom package is selected in whm. It will work if I am able to get username which is being used for creating cpanel account 0 -
Hello, It's likely a good idea to start using standardized hooks: This event returns the WHM API 1 createacct function's input parameters and values. Thank you. 0
Please sign in to leave a comment.
Comments
4 comments