PHP转换IP地址到真实地址

 1 $.getScript("http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js&ip="+clientIP,function(){
2 if(remote_ip_info.ret == '1'){
3 var country = remote_ip_info.country;
4 var province = remote_ip_info.province;
5 var city = remote_ip_info.city;
6 var isp = remote_ip_info.isp;
7 var type = remote_ip_info.type;
8 var desc = remote_ip_info.desc;
9 comeFrom = country + province + city;
10 ispName = isp;
11 )...
处于好奇,查询了 发现有几个主流的门户网站都是有提供这样查询的API。
如果需要查询自己的IP:http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js
查询自己所在的地址:http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=js&ip=host
由于是经过转码的,需要自己反码。
本文来源网页吧http://www.wangyeba.com

 

在开发过程中,有个需求,需要去获取用户的详细地址。

posted @ 2011-07-18 15:30  draem0507  阅读(1826)  评论(0编辑  收藏  举报
View Code