DirectAdmin API - issue with show user usage

feerdispzoo

Verified User
Joined
Jan 17, 2022
Messages
189
Code:
<?php

include '../protocol/httpsocket.php';

//nou de socket is geinclude kunnen we hem starten
$sock = new HTTPSocket;

$sock->connect('localhost',2222);
$sock->set_login("admin","mainpassword");
$sock->set_method('GET');
$sock->query("/CMD_API_SHOW_USER_USAGE",
           array(
        'user' => $_SESSION['myusername']
    ));
$result = $sock->fetch_body();

print_r($bandwidth, $quota, $domainptr, $ftp, $mysql, $nemailf, $nemailml, $nemailr, $nemails, $nsubdomains, $vdomains) = explode("&", $result);

echo $bandwidth."<br>";
echo $quota."<br>";
echo $domainptr."<br>";
echo $ftp;

?>

This above code return: full white page.

Connection with DA is correct, because I can create user API etc.

I try also change from print_r to list - still the same white page.
 
Back
Top