createacct() package name problem

testvto

Member
Jan 28, 2009
5
0
51
Hi,
i do have a problem while creating account using createacct() function.
I do have a package called "Package 6".When i create account using this package the created account list shows only "Package".

code is, createacct($host,$user,$accesshash,1,$domain_name,$cpanel_username,$cpanel_password,"Package 6",'[email protected]');

That is the space coming between "Package" and "6" is skipping.

Please help me to recover this issue.
 

cPanelKenneth

cPanel Development
Staff member
Apr 7, 2006
4,607
80
458
cPanel Access Level
Root Administrator
Please outline the steps, in detail, you are taking to create the account. Please indicate the full version of cPanel in use.
 

testvto

Member
Jan 28, 2009
5
0
51
Thanks for your reply.

cPanel Version is 11.24.4-RELEASE.

I am giving the test script am using for creating an account.

<?php


//CREATE CPANEL ACCOUNT
require 'php/Accounting.php.inc';
$host = "localhost";
$user = "root";
$accesshash = 'WHM Remote Access Key is given in this palce ';

$cpanel_username="chct130";
$cpanel_password="abcd1231";
$domain_name="chcchnet130Feb3.com";


$accts = createacct ($host,$user,$accesshash,1,$domain_name,$cpanel_username,$cpanel_password,"Package 6",'[email protected]');


echo " BELOW PRINT THE STATUS OF ACCOUNT CREATION";
echo '<pre>';
echo $accts;
echo '</pre>';

?>


Account is getting created but the package name which i have given not coming fully.Instead of "Package 6" only "Package" is coming under the account details.

The craeteacct() function from Accounting.php.inc is giving below,

function createacct ($host,$user,$accesshash,$usessl,$acctdomain,$acctuser,$acctpass,$acctplan,$useremail="") {
if($useremail=="")
{

$result = whmreq("/scripts/wwwacct?remote=1&nohtml=1&username=${acctuser}&password=${acctpass}&domain=${acctdomain}&plan=$acctplan",$host,$user,$accesshash,$usessl);
}
else
{

$result = whmreq("/scripts/wwwacct?remote=1&nohtml=1&username=${acctuser}&password=${acctpass}&domain=${acctdomain}&plan=$acctplan&contactemail=${useremail}",$host,$user,$accesshash,$usessl);
}
if ($cpanelaccterr != "") { return; }
return $result;
}
 
Last edited:

testvto

Member
Jan 28, 2009
5
0
51
Thank you very much for your help.:)

I have tried the php function urlencode().The idea is got from you.
 
Last edited: