Seek formy ip addresss...

Seekmesa.co.za - Seekmesa | WebsiteMy IP Please - Check Your IP Address
Your IP Address Is220.177.198.53
What is My IP Please?
is designed to check the IP Address which is assigned to you by your Internet Service Provider (ISP). Most commonly internet users need to know there IP Address when they want to share data with others using their IP. For example, if a user is running his/her own Email or Hosting Server and
ISP provider provides the dynamic IP, so problem starts, because every time when you lost connection with your ISP and re-connects so there are 90% chances that you will get the new IP address instead the old one that is why user must have to know his current IP Address. There are many more requirements to know the current IP address such as for gamming, remote desktop sharing and many many more.
comes in handy to check the current IP Address.
What is Internet Protocol (IP) Address?
An Internet Protocol address (IP address) is a numeric value (normally divided in 4 numeric values separated with “.” dot) assigned to each device (computer, printer, or any other network device) participating in a computer network that uses the Internet Protocol for communication.
An IP address perform two main things: host or network interface identification and location addressing. Its role has been characterized as follows: "A name indicates what we seek. An address indicates where it is. A route indicates how to get there."
The designers of the Internet Protocol defined an IP address as a 32-bit number
and this system, known as Internet Protocol Version 4 (IPv4), IPv4 is still largely in use. However, due to the rapidly growth of the Internet and the predicted depletion of available addresses, a new addressing system Internet Protocol Version 6 (IPv6), using 128 bits for the address, was developed in 1995, standardized as RFC 2460 in 1998, and its deployment has been ongoing since the mid-2000s.
IP addresses are binary numbers, but they are usually stored in text files and displayed in human-readable notations, such as 127.0.0.1 (for IPv4), and 2001:db8:0::8:1 (for IPv6).My IP address is:
220.177.198.53
IP Details:
Country code:
Ji'an
What is IP Address
An Internet Protocol address (IP address) is a numerical label assigned to each device (e.g., computer, printer) participating in a computer network that uses the Internet Protocol for communication.[1] An IP address serves two principal functions: host or network interface identification and location addressing. Its role has been characterized as follows: "A name indicates what we seek. An address indicates where it is. A route indicates how to get there.
The designers of the Internet Protocol defined an IP address as a 32-bit number[1] and this system, known as Internet Protocol Version 4 (IPv4), is still in use today. However, due to the enormous growth of the Internet and the predicted depletion of available addresses, a new addressing system (IPv6), using 128 bits for the address, was developed in 1995, standardized as RFC 2460 in 1998 and is being deployed worldwide since the mid-2000s. IP addresses are binary numbers, but they are usually stored in text files and displayed in human-readable notations, such as 172.16.254.1 (for IPv4), and 2001:db8:0::8:1 (for IPv6).
The Internet Assigned Numbers Authority (IANA) manages the IP address space allocations globally and delegates five regional Internet registries (RIRs) to allocate IP address blocks to local Internet registries (Internet service providers) and other entities.
@endsectionn
IP DetailsPHP转换IP地址到真实地址的方法详解
字体:[ ] 类型:转载 时间:
本篇文章是对PHP转换IP地址到真实地址的方法进行了详细的分析介绍,需要的朋友参考下
想要把IPv4地址转为真实的地址,肯定要参考IP数据库,商业的IP数据库存储在关系型数据库中,查询和使用都非常方便,但是成本不是个人和小公 司愿意承受的,所以简单应用的思路就是利用一些免费的IP数据库或者一些大网站提供的查询API,他们的数据量足够我们使用了。1. 利用纯真IP数据库利用本地的QQWry.Dat文件,优点是查询速度非常快,缺点是数据库文件要放在自己的空间内并且要偶尔更新数据库。时间关系废话不多说,下面是 使用这个文件的函数,如果是在WordPress里面使用这个功能,把下面的代码写入主题下面的functions.php里面,然后在 comments-list的输出&?php echo convertip(get_comment_author_ip()); ?&即可;如果是其他程序引用,输入一个有效的IPv4地址就可以得到一个真实的地址。 代码如下:function convertip($ip) {&&& //IP数据文件路径&&& $dat_path = 'QQWry.Dat';&&& //检查IP地址&&& //if(!preg_match("/^d{1,3}.d{1,3}.d{1,3}.d{1,3}$/", $ip)) {&&& //&&& return 'IP Address Error';&&& //}&&& //打开IP数据文件&&& if(!$fd = @fopen($dat_path, 'rb')){&&&&&&& return 'IP date file not exists or access denied';&&& }&&& //分解IP进行运算,得出整形数&&& $ip = explode('.', $ip);&&& $ipNum = $ip[0] *
+ $ip[1] * 65536 + $ip[2] * 256 + $ip[3];&&& //获取IP数据索引开始和结束位置&&& $DataBegin = fread($fd, 4);&&& $DataEnd = fread($fd, 4);&&& $ipbegin = implode('', unpack('L', $DataBegin));&&& if($ipbegin & 0) $ipbegin += pow(2, 32);&&& $ipend = implode('', unpack('L', $DataEnd));&&& if($ipend & 0) $ipend += pow(2, 32);&&& $ipAllNum = ($ipend - $ipbegin) / 7 + 1;&&& $BeginNum = 0;&&& $EndNum = $ipAllN&&& //使用二分查找法从索引记录中搜索匹配的IP记录&&& while($ip1num&$ipNum || $ip2num&$ipNum) {&&&&&&& $Middle= intval(($EndNum + $BeginNum) / 2);&&&&&&& //偏移指针到索引位置读取4个字节&&&&&&& fseek($fd, $ipbegin + 7 * $Middle);&&&&&&& $ipData1 = fread($fd, 4);&&&&&&& if(strlen($ipData1) & 4) {&&&&&&&&&&& fclose($fd);&&&&&&&&&&& return 'System Error';&&&&&&& }&&&&&&& //提取出来的数据转换成长整形,如果数据是负数则加上2的32次幂&&&&&&& $ip1num = implode('', unpack('L', $ipData1));&&&&&&& if($ip1num & 0) $ip1num += pow(2, 32);&&&&&&& //提取的长整型数大于我们IP地址则修改结束位置进行下一次循环&&&&&&& if($ip1num & $ipNum) {&&&&&&&&&&& $EndNum = $M&&&&&&&&&&&&&&&&&& }&&&&&&& //取完上一个索引后取下一个索引&&&&&&& $DataSeek = fread($fd, 3);&&&&&&& if(strlen($DataSeek) & 3) {&&&&&&&&&&& fclose($fd);&&&&&&&&&&& return 'System Error';&&&&&&& }&&&&&&& $DataSeek = implode('', unpack('L', $DataSeek.chr(0)));&&&&&&& fseek($fd, $DataSeek);&&&&&&& $ipData2 = fread($fd, 4);&&&&&&& if(strlen($ipData2) & 4) {&&&&&&&&&&& fclose($fd);&&&&&&&&&&& return 'System Error';&&&&&&& }&&&&&&& $ip2num = implode('', unpack('L', $ipData2));&&&&&&& if($ip2num & 0) $ip2num += pow(2, 32);&&&&&&& //没找到提示未知&&&&&&& if($ip2num & $ipNum) {&&&&&&&&&&& if($Middle == $BeginNum) {&&&&&&&&&&&&&&& fclose($fd);&&&&&&&&&&&&&&& return 'Unknown';&&&&&&&&&&& }&&&&&&&&&&& $BeginNum = $M&&&&&&& }&&& }&&& $ipFlag = fread($fd, 1);&&& if($ipFlag == chr(1)) {&&&&&&& $ipSeek = fread($fd, 3);&&&&&&& if(strlen($ipSeek) & 3) {&&&&&&&&&&& fclose($fd);&&&&&&&&&&& return 'System Error';&&&&&&& }&&&&&&& $ipSeek = implode('', unpack('L', $ipSeek.chr(0)));&&&&&&& fseek($fd, $ipSeek);&&&&&&& $ipFlag = fread($fd, 1);&&& }&&& if($ipFlag == chr(2)) {&&&&&&& $AddrSeek = fread($fd, 3);&&&&&&& if(strlen($AddrSeek) & 3) {&&&&&&&&&&& fclose($fd);&&&&&&&&&&& return 'System Error';&&&&&&& }&&&&&&& $ipFlag = fread($fd, 1);&&&&&&& if($ipFlag == chr(2)) {&&&&&&&&&&& $AddrSeek2 = fread($fd, 3);&&&&&&&&&&& if(strlen($AddrSeek2) & 3) {&&&&&&&&&&&&&&& fclose($fd);&&&&&&&&&&&&&&& return 'System Error';&&&&&&&&&&& }&&&&&&&&&&& $AddrSeek2 = implode('', unpack('L', $AddrSeek2.chr(0)));&&&&&&&&&&& fseek($fd, $AddrSeek2);&&&&&&& } else {&&&&&&&&&&& fseek($fd, -1, SEEK_CUR);&&&&&&& }&&&&&&& while(($char = fread($fd, 1)) != chr(0))&&&&&&&&&&& $ipAddr2 .= $&&&&&&& $AddrSeek = implode('', unpack('L', $AddrSeek.chr(0)));&&&&&&& fseek($fd, $AddrSeek);&&&&&&& while(($char = fread($fd, 1)) != chr(0))&&&&&&&&&&& $ipAddr1 .= $&&& } else {&&&&&&& fseek($fd, -1, SEEK_CUR);&&&&&&& while(($char = fread($fd, 1)) != chr(0))&&&&&&&&&&& $ipAddr1 .= $&&&&&&& $ipFlag = fread($fd, 1);&&&&&&& if($ipFlag == chr(2)) {&&&&&&&&&&& $AddrSeek2 = fread($fd, 3);&&&&&&&&&&& if(strlen($AddrSeek2) & 3) {&&&&&&&&&&&&&&& fclose($fd);&&&&&&&&&&&&&&& return 'System Error';&&&&&&&&&&& }&&&&&&&&&&& $AddrSeek2 = implode('', unpack('L', $AddrSeek2.chr(0)));&&&&&&&&&&& fseek($fd, $AddrSeek2);&&&&&&& } else {&&&&&&&&&&& fseek($fd, -1, SEEK_CUR);&&&&&&& }&&&&&&& while(($char = fread($fd, 1)) != chr(0)){&&&&&&&&&&& $ipAddr2 .= $&&&&&&& }&&& }&&& fclose($fd);&&& //最后做相应的替换操作后返回结果&&& if(preg_match('/http/i', $ipAddr2)) {&&&&&&& $ipAddr2 = '';&&& }&&& $ipaddr = "$ipAddr1 $ipAddr2";&&& $ipaddr = preg_replace('/CZ88.Net/is', '', $ipaddr);&&& $ipaddr = preg_replace('/^s*/is', '', $ipaddr);&&& $ipaddr = preg_replace('/s*$/is', '', $ipaddr);&&& if(preg_match('/http/i', $ipaddr) || $ipaddr == '') {&&&&&&& $ipaddr = 'Unknown';&&& }&$ipaddr = iconv('gbk', 'utf-8//IGNORE', $ipaddr); //转换编码,如果网页的gbk可以删除此行&&& return $}2. 利用门户网站的接口目前已知的有腾讯、新浪、网易、搜狐和Google提供IP地址查询API,但是找得到的只有腾讯、新浪和网易的,Google的貌似要用 Google Maps所以没有研究。看了下国内的几个腾讯提供的是JavaScript的,网易提供的是XML,而新浪的有多种格式可以用,注意非XML的数据源都是 GBK格式的,不管是JavaScript调用还是PHP调用都要转换一下编码,不然得到的是乱码。而更需要注意的是,如果一次性查询多个IP,使用门户 网站的API来查询会非常缓慢,我大概写了个for循环试了下,不管是用PHP解析XML还是file_get_contents()函数获取内容,查询 10次以上会变得非常缓慢,甚至可能超时。腾讯的IP地址API接口地址:/ipaddress,返回的是数据格式为:var IPData = new Array("123.124.2.85","","北京市","");,一个JavaScript的对象,目前还不知道如何输入IP查询。新浪的IP地址查询接口:http://int..cn/iplookup/iplookup.php?format=js新浪多地域测试方法:http://int..cn/iplookup/iplookup.php?format=js&ip=123.124.2.85网易有道的IP地址查询接口:/smartresult-xml/search.s?type=ip&q=123.124.2.85//腾讯API的PHP调用方法 代码如下:function getIpPlace(){&$ip=file_get_contents("/ipaddress");&$ip=str_replace('"',' ',$ip);&$ip2=explode("(",$ip);&$a=substr($ip2[1],0,-2);&$b=explode(",",$a);&return $b;}$ip=getIpPlace();print_r($ip);//有道API的PHP调用方法 代码如下:$url = "http:/smartresult-xml/search.s?type=ip&q=".$$doc = new DOMDocument();&& $doc-&load($url);&& $smartresult = $doc-&getElementsByTagName("product");&& foreach($smartresult as $product)&& {&&&&& $locations = $product-&getElementsByTagName("location");&&&&& $location = $locations-&item(0)-&nodeV&& }&& if($location != "")&& {&&&&&& echo $i.".".$&&&&&& echo "& 来自".$location."的网友";&& }&& else&& {&&&&&& echo $i.".".$&&&&&& echo "& 来自火星的网友";&& }public function sinaIPApi($ip){&& $str = file_get_contents("http://int..cn/iplookup/iplookup.php?ip=".$ip);&& $str = iconv("gbk", "utf-8//IGNORE", $str);&& preg_match_all("/[/x{4e00}-/x{9fa5}]+/u",$str,$get);&& $add = implode('',$get[0]);&& return $}//$get是一个非常棒的二维数组其中有道和新浪的是我自己写的,新浪API也可以像腾讯API那样用file_get_contents()函数获取完地址后使用一连串的字符串函 数处理,我写的函数使用正则表达式从新浪的返回结果中提供包含中文的字符串,并且分段存入一个二维数组,这个可能只是针对新浪的API有用并且存在 bug。举个例子查询学校分配给我的IP地址后var_dump()一下函数里面的$get变量得到以下结果: array(1) { [0]=& array(6) { [0]=& string(6) "中国" [1]=& string(6) "北京" [2]=& string(6) "北京" [3]=& string(9) "教育网" [4]=& string(6) "学校" [5]=& string(18) "中国地质大学" } },而函数输出的结果则是“中国北京北京教育网学校中国地质大学”,希望我的思路和方法能对别人有用。最后再次提醒,如果是WordPress请使用第一种方法,否则使用API同时查询所有留言者的真实地址会让PHP超时的,希望各路大牛有更好的方 法,至于限制显示和显示方式等神马的都是WordPress应用问题,同时对于Java和C#来说思路也是一样的,这些后续的问题等我考完试再细说。
您可能感兴趣的文章:
大家感兴趣的内容
12345678910
最近更新的内容
常用在线小工具My IP address is:
220.177.198.53
IP Details:
Country code:
Ji'an
What is IP Address
An Internet Protocol address (IP address) is a numerical label assigned to each device (e.g., computer, printer) participating in a computer network that uses the Internet Protocol for communication.[1] An IP address serves two principal functions: host or network interface identification and location addressing. Its role has been characterized as follows: "A name indicates what we seek. An address indicates where it is. A route indicates how to get there.
The designers of the Internet Protocol defined an IP address as a 32-bit number[1] and this system, known as Internet Protocol Version 4 (IPv4), is still in use today. However, due to the enormous growth of the Internet and the predicted depletion of available addresses, a new addressing system (IPv6), using 128 bits for the address, was developed in 1995, standardized as RFC 2460 in 1998 and is being deployed worldwide since the mid-2000s. IP addresses are binary numbers, but they are usually stored in text files and displayed in human-readable notations, such as 172.16.254.1 (for IPv4), and 2001:db8:0::8:1 (for IPv6).
The Internet Assigned Numbers Authority (IANA) manages the IP address space allocations globally and delegates five regional Internet registries (RIRs) to allocate IP address blocks to local Internet registries (Internet service providers) and other entities.
@endsectionn
IP Details

我要回帖

更多关于 my ip address 的文章

 

随机推荐