justinedwards
New member
- Joined
- May 12, 2011
- Messages
- 2
I'm sure this is posted elsewhere, but I don't have the patience to search for it. Using the Direct Admin API, I need to get the username that is currently logged in. I am not worried about decoding yet, I just want to see the encoded version right now, I have:
Using this, I get: "error=1&details=no container class for data"
Any suggestions?
PHP:
<?php
include 'directadmin.php';
$sock = new HTTPSocket;
$visitorip = $_SERVER['REMOTE_ADDR'];
$sessionid = "";
$sock->connect("clicktwicehosting.com", 2222);
$sock->set_login("Username","Password");
$sock->set_method('POST');
$sock->query('/CMD_API_GET_SESSION',
array(
'ip' => "$visitorip",
'session_id' => "$sessionid"
));
$result = $sock->fetch_body();
echo $result;
?>
Using this, I get: "error=1&details=no container class for data"
Any suggestions?