Rushil Pachchigar Rushil Pachchigar - 13 days ago 5
PHP Question

Delete database using cpanel api


Delete database using cpanel api


I want to do delete database using cpanel api in php so anyone have idea how would be the code?

Answer

Apply the following code:

$xmlapi = new xmlapi("cpanelip"); 
$xmlapi->set_port( 2083 );   
$xmlapi->password_auth('cpanelusername','cpanelpaasword');
$xmlapi->set_debug(0);//output actions in the error log 1 for true and 0 false 
$cpaneluser='cpaneluser';
$databasename='databasename';
$databaseuser="databaseuser";
$databasepass='databasepass';
$servername = DB_HOST;
$deletedb = $xmlapi->api1_query($cpaneluser, "Mysql", "deldb", array($databasename));
Comments