I am trying to make a simple API that when ran will take the input of the user’s IP address and search for it in the host list get the mac address and make that address a stored variable to be used in additional API coding. My first step is just trying to get the Paramateres correct for the info to show on the web page. I know I am getting my $ip variable from my previous test.
if(isset($_POST[‘button1’])) {
$ip = $_GET[‘subject’];
$API = new RouterosAPI();
$apiParamArr[‘where address’]=$ip;
if ($API->connect(‘ip of tik’, ‘UN’, ‘PW’)) {
$API->write(‘/ip/hotspot/host/print’, $apiParamArr);
$ARRAY = $API->read();
print_r($ARRAY);
$API->disconnect();
}
Thanks