IP来源查询php源代码
if (strlen($buf) == 0) { return 1; } $this->Rec->StartIP= (substr($buf, 0, 17)); $this->Rec->EndIP= trim(substr($buf, 17, 22)); $this->Rec->Country= trim(substr($buf, 17 22, 13)); $this->Rec->Local= trim(substr($buf, 17 22 13, 47)); return 0; } // Go to Record Number function Seek($RecNo) { return fseek($this->fp, $RecNo * $this->RECORDLENGTH $this->DATAFIELDBEGIN, SEEK_SET); } // Where_are_you Main tion /********************************************* * 使用说明 * 参数: * IP 合法IP地址即可 * szLocal 是保存返回的结果字符串的 * 返回值: * 此函数有返回值,可以根据返回值自行处理结果 * 0: 查找成功 * -1: 无效的IP * 1: 打开数据库文件失败 * 2: 数据文件错误(没找到有效记录) * 3: 未知 IP **********************************************/ function wru($ip, &$szLocal) { $this->Rec= new TRec; $nRet= 0; $this->RECORDLENGTH= 17 22 13 47 12 1; if ($this->FormatIP($ip) != 0) { $szLocal= "InvalidIP"; return -1; } $this->fp= fopen(DBFILENAME, "rb"); if ($this->fp == NULL) { $szLocal= "OpenFileError"; return 1; } // Get Record Count fseek($this->fp, 0, SEEK_END); $RecordCount= floor((ftell($this->fp) - $this->DATAFIELDBEGIN) / $this->RECORDLENGTH); if ($RecordCount <= 1) { $szLocal= "FileDataError"; $nRet= 2; } else { $RangB= 0; $RangE= $RecordCount; // Match ... while ($RangB < $RangE-1) { $RecNo= floor(($RangB $RangE) / 2); $this->ReadRec($RecNo); if (strcmp($this->ip, $this->Rec->StartIP) >=0 && strcmp($this->ip, $this->Rec->EndIP) <=0 ) break; //Found match record if (strcmp($this->ip, $this->Rec->StartIP) > 0) $RangB= $RecNo; else $RangE= $RecNo; } if (!($RangB < $RangE-1)) { $szLocal= "UnknowLocal!"; $nRet= 3; } else { // Match ess $szLocal= $this->Rec->Country; $szLocal.= $this->Rec->Local; } } fclose($this->fp); return $nRet; } }
/kh/yuandaima_yuanma_qidongyuanshima_weijijiemi/
georgedatacenter怎么样?GeorgeDatacenter是一家2017年成立的美国商家,正规注册公司(REG: 10327625611),其实是oneman。现在有优惠,有几款特价VPS,基于Vmware。支持Paypal付款。GeorgeDatacenter目前推出的一款美国vps,2核/8GB内存/250GB NVMe空间/2TB流量/1Gbps端口/Vmware/洛杉矶/达拉...
spinservers是Majestic Hosting Solutions LLC旗下站点,商家提供国外服务器租用和Hybrid Dedicated等产品,数据中心包括美国达拉斯和圣何塞机房,机器默认10Gbps端口带宽,高配置硬件,支持使用PayPal、信用卡、支付宝或者微信等付款方式。农历春节之际,商家推出了几款特别促销配置,最低双路E5-2630Lv3机器每月149美元起,下面列出几款机器...
轻云互联成立于2018年的国人商家,广州轻云互联网络科技有限公司旗下品牌,主要从事VPS、虚拟主机等云计算产品业务,适合建站、新手上车的值得选择,香港三网直连(电信CN2GIA联通移动CN2直连);美国圣何塞(回程三网CN2GIA)线路,所有产品均采用KVM虚拟技术架构,高效售后保障,稳定多年,高性能可用,网络优质,为您的业务保驾护航。官方网站:点击进入广州轻云网络科技有限公司活动规则:1.用户购...