Hello I’m newbies in Mikrotik . I would like to manage user from userman using PHP how I do?
i tried to use php api but not work!
require(‘routeros_api.class.php’);
$API = new routeros_api();
$API->debug = true;
if ($API->connect(‘192.168.88.1’, ‘admin’, ‘’)) {
$API->write(‘/tool/user-manager/user/getall’, false);
$API->write(‘=name=test=password=test=uptime-limit=2d’, false);
$API->write(‘=credit-time=2d’, false);
$API->write(‘=subcribe=admin’);
$READ = $API->read(false);
$ARRAY = $API->parse_response($READ);
// echo “
”;print_r($ARRAY);echo “
”;
$API->disconnect();
}
how i get username password etc.. like userman
thank you!!

Where did you get your code sample from?
This is the second time I’ve seen the exact same error for the exact same purpose, leading me to believe you’re copy&paste-ing from a blog/forum post or something, without realizing what it’s doing, and why it’s wrong.
If you want to get everything about every user, just remove the arguments, and instead of using “getall”, consider using “print”.
thank you so much
it work!!
<?php
require('routeros_api.class.php');
$API = new routeros_api();
$API->debug = true;
if ($API->connect('192.168.88.1', 'admin', '')) {
$API->write('/tool/user-manager/user/getall');
$READ = $API->read(false);
$ARRAY = $API->parse_response($READ);
// echo "
";print_r($ARRAY);echo "
";
$API->disconnect();
}
?>