根据PPPOE拨号获取用户信息
来源:互联网 发布:2015年网络购物交易额 编辑:程序博客网 时间:2024/04/28 05:15
function ppp_status($if, $info) {
if ( "ifaceinfo" == $info ) {
$ifinfo = array();
unset($linkinfo);
exec("/bin/netstat -I " .$if . " -nWb -f link", $linkinfo);
$linkinfo = preg_split("/\s+/", $linkinfo[1]);
return $linkinfo;
} else {
unset($ifconfiginfo);
exec("/sbin/ifconfig " . $if, $ifconfiginfo);
foreach ($ifconfiginfo as $ici) {
if (preg_match("/--> (\S+)/", $ici, $matches)) {
$ipaddress = $matches[1];
}
}
return $ipaddress;
}
}
@$fp=fopen("http://localhost:5006","r") ;//判断网页能否打开
if ( !$fp ) {
return;
} else {
while ($buffer = fgets($fp, 4096)) {
$fcontents .=$buffer;
}
fclose($fp);
$regs = explode("<TR>",$fcontents);
$pppoe_info = array();
$info = array();
$i = 0;
foreach( $regs as $key=>$value ) {
$User=explode("auth\">",$regs[$key]);
$User = explode("</a></TD>",$User[1]);
$Iface=explode('iface">',$regs[$key]);
$Iface = explode("</a></TD>",$Iface[1]);
$Link = explode("show%20link\">",$regs[$key]);
$Link = explode("</a></TD>",$Link[1]);
if ( "" != $User[0] ) {
$pppoe_info[$i]['user'] = $User[0];
$pppoe_info[$i]['iface'] = $Iface[0];
//$info = ppp_status($pppoe_info[$i]['iface'],"ifaceinfo");
//$pppoe_info[$i]['inbytes'] = $info[5];
//$pppoe_info[$i]['outbytes'] = $info[8];
$pppoe_info[$i]['ipaddress'] = ppp_status($pppoe_info[$i]['iface']," ");
$pppoe_info[$i]['link'] = $Link[0];
$i++;
}
}
return $pppoe_info;//print_r( $pppoe_info);
}
- 根据PPPOE拨号获取用户信息
- PPPOE拨号
- pppoe拨号
- uclinux 下PPPoE 拨号
- VC实现PPPOE拨号
- PPPoE拨号调试
- PPPoE拨号过程解析
- PPPOE拨号过程
- ubantu pppoe拨号
- Android 实现PPPoE拨号
- Android 实现PPPoE拨号
- PPPoE拨号流程
- VC实现PPPOE拨号
- OpenWrt之PPPoE拨号
- PPPoE拨号流程
- PPPoE拨号流程
- PPPoE拨号流程
- 华为配置PPPOE拨号
- oracle redo
- 函数引用形参的初始化
- basename妙用于去除字符串结尾某段字符
- Android SharedPreferences的使用
- oracle翻页,排序字段重复,翻页结果重复 问题的解决方法
- 根据PPPOE拨号获取用户信息
- Nginx模块开发入门
- 题目
- 计算机科学数学理论
- tomcat5.5与jdk1.4不兼容
- IOS-调整UINavigationBar高度
- 关键字搜索 重要性
- 派生类的构造函数
- HPUnix增加磁盘分区空间的方法