change Package with remote access, is it possible?

kgp43

Active Member
Aug 25, 2004
27
0
156
Hi,

I create new account using "Remote Access". I would like to change plan/package this way too, is it possible?
 

elleryjh

Well-Known Member
Apr 12, 2003
475
0
166
Using PHP:

Include the standard Accounting.php.inc file, then add this code to the script that does the upgrade

PHP:
<?php

function changepackage($host,$user,$accesshash,$usessl, $username,$package) {
        $result = whmreq("/scripts2/upacct?user=${username}&pkg=${package}",$host,$user,$accesshash,$usessl);
        if ($cpanelaccterr != "") { return; }
        return $result;
}
?>
Now you will be able to use the fuction like this, similar to the way you use the creation function
changepackage("locahost", "reselleracct", "ik0832hhfh", 1, "someuser", "Platnum")

If you use Perl, the process is similar.