Api_ftp

vasudev_bhat

New member
Joined
Mar 7, 2008
Messages
1
hi..
i have been breaking my head on creating an FTP account when a user is created on my site but it doesnt seem to work.
i am using the codes which i have got on DA server
this is the code i am using
===============
<?
error_reporting(E_ALL);
include 'httpsocket.php';

$sock = new HTTPSocket;
$sock->connect('www.domain.com');
$sock->set_login('admin','pass');


$sock->set_method('POST');
$sock->query('/CMD_API_FTP',
array(
'action' => 'create',
'domain' => 'domain.com',
'user' => 'testy',
'type' => 'ftp',
'user' => '/home/admin/domains/domain.com/public_html/clients/',
'passwd' => 'testpas',
'passwd2' => 'testpas',
'create' => 'Create'
));
$result = $sock->fetch_body();
echo $sock->get_status_code();
if ( $sock->get_status_code() != 200 || !empty($result['error']) )
{
// failure.
echo "Failed to add new ftp: {$result[0]}<br />{$result[1]}";
}
print_r($result);
?>
====================
PLZZZZZZZZZZZZZZZ HELPPPPP
THANX IN ADVANCE
 
Back
Top