Web Hosting Talk







View Full Version : Cpanel accountig - don`t know what`s wrong?!


loop
03-18-2005, 11:20 AM
Hi!

I try to write small php script that create an account in my WHM. I try to use WHM build createacct function.

I have something like this:


require ('/usr/local/cpanel/Cpanel/Accounting.php.inc');

$whm_host="localhost";
$whm_user="my_whm_user";
$whm_usessl="1";
$whm_key="my_accesshash";

$acc_login="user1";
$acc_pass="passuser1";
$acc_plan="plan1";
$acc_domain=$acc_login.".mydomain.pl";

$status = createacct($whm_host,$whm_user,$whm_key,$whm_usessl,$acc_domain,$acc_login,$acc_pass,$acc_plan);

echo $status;


Unfortunetly this code want work. Even var $status want return enything. I try with SSL and SOCKET connection, with mydomain and localhost, i try everything and I still don`t have even error message, just blank page :(

Please help me if you know whats wrong.

insanelymacintosh
03-18-2005, 09:16 PM
It will be hard to tell you what is wrong without some more info. Does it give you an error message or anything?

deadserious
03-18-2005, 10:06 PM
I've never used the PHP accounting module, but this variable in your code doesn't seem right for some reason:

$acc_domain=$acc_login.".mydomain.pl";

I don't know why you would have the "mydomain.pl" part in there. It looks like you are trying to append that to the $acc_login variable for some reason? But from looking at it I don't think that you're even achieving that.