找回密码
 注册

QQ登录

只需一步,快速开始

搜索
查看: 7005|回复: 1

[Hotspot] API接口如何删除hotspot用户,我用的是PHP语言

[复制链接]
发表于 2017-8-8 14:15:56 | 显示全部楼层 |阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?注册

×
  1.      $API->write('/ip/dns/static/remove', false);
  2.      $API->write("=.id=" . $ip_data[".id"], true);
复制代码


开发文档案例有这种源码,但这只针对id进行删除,但是hotspot的用户没有按ID删除的,我该怎么做呢??
routeros
发表于 2017-8-9 21:20:51 | 显示全部楼层
<?php
require('./routeros.class.php');
$api=new RouterosAPI();
$api->debug=false;
if($api->connect('192.168.1.1','admin','password')){
   $result=$api->comm('/ip/hotspot/user/print',array('?name'=>'zhangsan','.proplist'=>'.id'));
   $api->comm('/ip/hotspot/user/remove',array('.id'=>$result[0]['.id']));
   $api->disconnect();
}
?>
routeros
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|小黑屋|软路由 ( 渝ICP备15001194号-1|渝公网安备 50011602500124号 )

GMT+8, 2024-5-2 16:53 , Processed in 0.049526 second(s), 6 queries , Gzip On, Redis On.

Powered by Discuz! X3.5 Licensed

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表