Hey,
I am using the class posted in this forum section but it just doesn't works if I want to get the information out of an array,
I am using PHP. The script:
Can someone see the bug?
At the end he shows the username, e-mail pass domain plan and the ip adress but it wont make the account
I am using the class posted in this forum section but it just doesn't works if I want to get the information out of an array,
I am using PHP. The script:
PHP:
include ('da_config.php');
$query = "SELECT * FROM config";
$result = mysql_query($query) or die (mysql_error(''));
while($obj = mysql_fetch_assoc($result)) {
if($obj['config_naam'] == "da_domeinnaam") {
$da_domein = $obj['config_waarde'];
}elseif($obj['config_naam'] == "da_poort") {
$da_poort = $obj['config_waarde'];
}elseif($obj['config_naam'] == "da_username") {
$uname = $obj['config_waarde'];
}elseif($obj['config_naam'] == "da_pass") {
$passwd = $obj['config_waarde'];
}elseif($obj['config_naam'] == "da_ip") {
$da_ip = $obj['config_waarde']; }
}
$sock = new HTTPSocket;
$sock->connect($da_domein,$da_poort);
$sock->set_login($uname,$passwd);
$sock->set_method('POST');
include('password.php');
foreach($_POST['domein'] as $domain){
foreach ($_POST[''.str_replace(".", "_", $domain).'_plan'] as $da_plan){
$sql = "SELECT * FROM plan";
$resultaat = mysql_query($sql) or die(mysql_error());
$aantal = mysql_num_rows($resultaat);
while ($record = mysql_fetch_object($resultaat)) {
if ($da_plan == $record->planid) {
$da_plan2 = $record->da_plannaam; }
}
$username = substr ("$domain", -8, 8);
$pass = genlatpas(9);
$array = array(
'action' => 'create',
'add' => 'Submit',
'username' => $username,
'email' => $email,
'passwd' => $pass,
'passwd2' => $pass,
'domain' => $domain,
'package' => $da_plan2,
'ip' => $da_ip,
'notify' => 'no',
);
$sock->query('/CMD_ACCOUNT_USER',$array);
$result = $sock->fetch_body();
echo $username;
echo $email;
echo $pass;
echo $domain;
echo $da_plan2;
echo $da_ip;
}}}
Can someone see the bug?
At the end he shows the username, e-mail pass domain plan and the ip adress but it wont make the account