0 Members and 1 Guest are viewing this topic.
Coba anda pelajari bagaimana script add, delete, simplelist dan reflect yang anda di /script. Ini command-line yang fungsinya sama dengan json.
function lxlabs_get_via_json($protocol, $server, $port, $param){$param = "login-class=client&login-name=admin&login-password=pass&output-type=json&$param";$url = "$protocol://$server:$port/webcommand.php";$ch = curl_init($url);curl_setopt($ch, CURLOPT_POST, true);curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false);curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false);curl_setopt($ch, CURLOPT_POSTFIELDS, $param);$totalout = curl_exec($ch);$totalout = trim($totalout);require_once('JSON.php');$json = new Services_JSON();$object = $json->decode($totalout);if (!is_object($object)) {print("Fatal Error. Got a non-object from the server: $totaloutn");exit;}return $object;}
Page created in 0.048 seconds with 18 queries.