Master,
Help me,
I try to create user radius with api php
i search in google for 1 week but not found anything
i use class api from miktotik
this is the code
$api->connect($ip,$username,$password)
{
$api->write(‘/tool/user-manager/user/add)
$api->write(’=name=test=password=test=uptime-limit=2d’)
$api->write(‘=credit-time=2d=subcribe=admin’,false)
$api->read(false)
}
User not created. Please help me to finish my homework.
Well… I’m happy you’re admitting it’s homework… Typically, most people (myself included) wouldn’t answer such questions as a matter of policy, but it’s a simple enough question, and you’re on the right track so…
The second argument needs to be “false” when there are more words in the sentence, and can be omitted when the value would be “true”. Also, you’re missing an apostrophe on the first write() call, and are missing virtually all “;”… And “subsribe” I’d guess is a separate argument.
i.e.
$api->write('/tool/user-manager/user/add', false);
$api->write('=name=test=password=test=uptime-limit=2d', false);
$api->write('=credit-time=2d', false);
$api->write('=subcribe=admin');
thx u, is working, thanku very much master