create package in reseller account with API-question

john alabama

Verified User
Joined
Jul 31, 2005
Messages
9
Hello everyone i'm traying to create a user package but something whent wrong...
please look at this code and try to understand what is the prob.
this is the code:
PHP:
<?php

include 'httpsocket.php';

$sock = new HTTPSocket;
$sock->connect('xx.xx.xx.xx',2222);

$sock->set_login("xxx","xxx");

$sock->set_method('GET');

$sock->query('/CMD_SHOW_USER_PACKAGE',array(
'add' => 'Save',
'bandwidth'=> '1000000',
'quota'=> '10',
'vdomains'=> '1',
'nsubdomains'=> '0',
'nemails'=> '1',
'nemailf'=> '1',
'nemailml'=> '1',
'nemailr'=> '1',
'mysql'=> '1',
'domainptr'=> '1',
'ftp'=> '1',
'aftp'=> 'OFF',
'cgi'=> 'ON',
'php'=> 'ON',
'spam'=> 'ON',
'ssl'=> 'ON',
'ssh'=> 'OFF',
'dnscontrol'=> 'OFF',
'suspend_at_limit'=> 'ON',
'skin'=> 'default',
'packagename'=> 'asd2'
    ));

?>
forgive me on my English it's very week:(
:D
 
Last edited:
That's not an API command first of all.
http://www.directadmin.com/api.html

It has been said that you can use the socket class to do anything DirectAdmin can by calling the pages like that, but it requires extra work and parsing since the output won't be pretty. You'll have to make sure the set_method is correct (most likely post), and you'll have to match form names with your input etc.
 
jmstacey said:
That's not an API command first of all.
http://www.directadmin.com/api.html

It has been said that you can use the socket class to do anything DirectAdmin can by calling the pages like that, but it requires extra work and parsing since the output won't be pretty. You'll have to make sure the set_method is correct (most likely post), and you'll have to match form names with your input etc.
that what i was doing but from some reson it didnt work..
i successfuly do this in cronjob and ftp....:( ....
10x for the reply
 
Back
Top