├── favicon.ico ├── static ├── logo.png ├── newlogo.png ├── loading_new.gif ├── style.css ├── about.html └── embed.js ├── layui ├── font │ ├── iconfont.eot │ ├── iconfont.ttf │ └── iconfont.woff ├── images │ └── face │ │ ├── 0.gif │ │ ├── 1.gif │ │ ├── 10.gif │ │ ├── 11.gif │ │ ├── 12.gif │ │ ├── 13.gif │ │ ├── 14.gif │ │ ├── 15.gif │ │ ├── 16.gif │ │ ├── 17.gif │ │ ├── 18.gif │ │ ├── 19.gif │ │ ├── 2.gif │ │ ├── 20.gif │ │ ├── 21.gif │ │ ├── 22.gif │ │ ├── 23.gif │ │ ├── 24.gif │ │ ├── 25.gif │ │ ├── 26.gif │ │ ├── 27.gif │ │ ├── 28.gif │ │ ├── 29.gif │ │ ├── 3.gif │ │ ├── 30.gif │ │ ├── 31.gif │ │ ├── 32.gif │ │ ├── 33.gif │ │ ├── 34.gif │ │ ├── 35.gif │ │ ├── 36.gif │ │ ├── 37.gif │ │ ├── 38.gif │ │ ├── 39.gif │ │ ├── 4.gif │ │ ├── 40.gif │ │ ├── 41.gif │ │ ├── 42.gif │ │ ├── 43.gif │ │ ├── 44.gif │ │ ├── 45.gif │ │ ├── 46.gif │ │ ├── 47.gif │ │ ├── 48.gif │ │ ├── 49.gif │ │ ├── 5.gif │ │ ├── 50.gif │ │ ├── 51.gif │ │ ├── 52.gif │ │ ├── 53.gif │ │ ├── 54.gif │ │ ├── 55.gif │ │ ├── 56.gif │ │ ├── 57.gif │ │ ├── 58.gif │ │ ├── 59.gif │ │ ├── 6.gif │ │ ├── 60.gif │ │ ├── 61.gif │ │ ├── 62.gif │ │ ├── 63.gif │ │ ├── 64.gif │ │ ├── 65.gif │ │ ├── 66.gif │ │ ├── 67.gif │ │ ├── 68.gif │ │ ├── 69.gif │ │ ├── 7.gif │ │ ├── 70.gif │ │ ├── 71.gif │ │ ├── 8.gif │ │ └── 9.gif ├── css │ ├── modules │ │ ├── layer │ │ │ └── default │ │ │ │ ├── icon.png │ │ │ │ ├── icon-ext.png │ │ │ │ ├── loading-0.gif │ │ │ │ ├── loading-1.gif │ │ │ │ ├── loading-2.gif │ │ │ │ └── layer.css │ │ ├── code.css │ │ └── laydate │ │ │ └── default │ │ │ └── laydate.css │ └── layui.mobile.css ├── lay │ └── modules │ │ ├── code.js │ │ ├── laytpl.js │ │ ├── flow.js │ │ ├── util.js │ │ ├── tree.js │ │ ├── carousel.js │ │ ├── laypage.js │ │ ├── upload.js │ │ ├── element.js │ │ ├── form.js │ │ ├── layedit.js │ │ ├── table.js │ │ ├── layer.js │ │ ├── laydate.js │ │ └── mobile.js └── layui.js ├── readme.md ├── AllInfo.php ├── GetInfo.php └── index.php /favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/favicon.ico -------------------------------------------------------------------------------- /static/logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/static/logo.png -------------------------------------------------------------------------------- /static/newlogo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/static/newlogo.png -------------------------------------------------------------------------------- /layui/font/iconfont.eot: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/font/iconfont.eot -------------------------------------------------------------------------------- /layui/font/iconfont.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/font/iconfont.ttf -------------------------------------------------------------------------------- /layui/font/iconfont.woff: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/font/iconfont.woff -------------------------------------------------------------------------------- /layui/images/face/0.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/0.gif -------------------------------------------------------------------------------- /layui/images/face/1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/1.gif -------------------------------------------------------------------------------- /layui/images/face/10.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/10.gif -------------------------------------------------------------------------------- /layui/images/face/11.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/11.gif -------------------------------------------------------------------------------- /layui/images/face/12.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/12.gif -------------------------------------------------------------------------------- /layui/images/face/13.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/13.gif -------------------------------------------------------------------------------- /layui/images/face/14.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/14.gif -------------------------------------------------------------------------------- /layui/images/face/15.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/15.gif -------------------------------------------------------------------------------- /layui/images/face/16.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/16.gif -------------------------------------------------------------------------------- /layui/images/face/17.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/17.gif -------------------------------------------------------------------------------- /layui/images/face/18.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/18.gif -------------------------------------------------------------------------------- /layui/images/face/19.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/19.gif -------------------------------------------------------------------------------- /layui/images/face/2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/2.gif -------------------------------------------------------------------------------- /layui/images/face/20.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/20.gif -------------------------------------------------------------------------------- /layui/images/face/21.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/21.gif -------------------------------------------------------------------------------- /layui/images/face/22.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/22.gif -------------------------------------------------------------------------------- /layui/images/face/23.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/23.gif -------------------------------------------------------------------------------- /layui/images/face/24.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/24.gif -------------------------------------------------------------------------------- /layui/images/face/25.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/25.gif -------------------------------------------------------------------------------- /layui/images/face/26.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/26.gif -------------------------------------------------------------------------------- /layui/images/face/27.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/27.gif -------------------------------------------------------------------------------- /layui/images/face/28.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/28.gif -------------------------------------------------------------------------------- /layui/images/face/29.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/29.gif -------------------------------------------------------------------------------- /layui/images/face/3.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/3.gif -------------------------------------------------------------------------------- /layui/images/face/30.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/30.gif -------------------------------------------------------------------------------- /layui/images/face/31.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/31.gif -------------------------------------------------------------------------------- /layui/images/face/32.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/32.gif -------------------------------------------------------------------------------- /layui/images/face/33.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/33.gif -------------------------------------------------------------------------------- /layui/images/face/34.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/34.gif -------------------------------------------------------------------------------- /layui/images/face/35.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/35.gif -------------------------------------------------------------------------------- /layui/images/face/36.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/36.gif -------------------------------------------------------------------------------- /layui/images/face/37.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/37.gif -------------------------------------------------------------------------------- /layui/images/face/38.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/38.gif -------------------------------------------------------------------------------- /layui/images/face/39.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/39.gif -------------------------------------------------------------------------------- /layui/images/face/4.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/4.gif -------------------------------------------------------------------------------- /layui/images/face/40.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/40.gif -------------------------------------------------------------------------------- /layui/images/face/41.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/41.gif -------------------------------------------------------------------------------- /layui/images/face/42.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/42.gif -------------------------------------------------------------------------------- /layui/images/face/43.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/43.gif -------------------------------------------------------------------------------- /layui/images/face/44.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/44.gif -------------------------------------------------------------------------------- /layui/images/face/45.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/45.gif -------------------------------------------------------------------------------- /layui/images/face/46.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/46.gif -------------------------------------------------------------------------------- /layui/images/face/47.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/47.gif -------------------------------------------------------------------------------- /layui/images/face/48.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/48.gif -------------------------------------------------------------------------------- /layui/images/face/49.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/49.gif -------------------------------------------------------------------------------- /layui/images/face/5.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/5.gif -------------------------------------------------------------------------------- /layui/images/face/50.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/50.gif -------------------------------------------------------------------------------- /layui/images/face/51.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/51.gif -------------------------------------------------------------------------------- /layui/images/face/52.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/52.gif -------------------------------------------------------------------------------- /layui/images/face/53.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/53.gif -------------------------------------------------------------------------------- /layui/images/face/54.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/54.gif -------------------------------------------------------------------------------- /layui/images/face/55.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/55.gif -------------------------------------------------------------------------------- /layui/images/face/56.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/56.gif -------------------------------------------------------------------------------- /layui/images/face/57.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/57.gif -------------------------------------------------------------------------------- /layui/images/face/58.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/58.gif -------------------------------------------------------------------------------- /layui/images/face/59.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/59.gif -------------------------------------------------------------------------------- /layui/images/face/6.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/6.gif -------------------------------------------------------------------------------- /layui/images/face/60.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/60.gif -------------------------------------------------------------------------------- /layui/images/face/61.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/61.gif -------------------------------------------------------------------------------- /layui/images/face/62.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/62.gif -------------------------------------------------------------------------------- /layui/images/face/63.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/63.gif -------------------------------------------------------------------------------- /layui/images/face/64.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/64.gif -------------------------------------------------------------------------------- /layui/images/face/65.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/65.gif -------------------------------------------------------------------------------- /layui/images/face/66.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/66.gif -------------------------------------------------------------------------------- /layui/images/face/67.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/67.gif -------------------------------------------------------------------------------- /layui/images/face/68.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/68.gif -------------------------------------------------------------------------------- /layui/images/face/69.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/69.gif -------------------------------------------------------------------------------- /layui/images/face/7.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/7.gif -------------------------------------------------------------------------------- /layui/images/face/70.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/70.gif -------------------------------------------------------------------------------- /layui/images/face/71.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/71.gif -------------------------------------------------------------------------------- /layui/images/face/8.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/8.gif -------------------------------------------------------------------------------- /layui/images/face/9.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/images/face/9.gif -------------------------------------------------------------------------------- /static/loading_new.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/static/loading_new.gif -------------------------------------------------------------------------------- /layui/css/modules/layer/default/icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/css/modules/layer/default/icon.png -------------------------------------------------------------------------------- /layui/css/modules/layer/default/icon-ext.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/css/modules/layer/default/icon-ext.png -------------------------------------------------------------------------------- /layui/css/modules/layer/default/loading-0.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/css/modules/layer/default/loading-0.gif -------------------------------------------------------------------------------- /layui/css/modules/layer/default/loading-1.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/css/modules/layer/default/loading-1.gif -------------------------------------------------------------------------------- /layui/css/modules/layer/default/loading-2.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/gytai/IPinfo/master/layui/css/modules/layer/default/loading-2.gif -------------------------------------------------------------------------------- /readme.md: -------------------------------------------------------------------------------- 1 | # IPinfo 2 | IPinfo是一个集合多接口的IP地址查询工具 3 | 4 | ### 使用 5 | IPinfo使用PHP开发,开箱即用,下载源码后直接放到站点根目录即可。 6 | 7 | ### Demo 8 | * [https://ip.awk.sh/](https://ip.awk.sh/) 9 | 10 | ![](https://imgurl.org/upload/1803/55fddb2f1faf7ce5.png) 11 | 12 | ![](https://imgurl.org/upload/1803/076e5eb67466d11a.png) 13 | 14 | ### 联系我 15 | * Blog:[https://www.xiaoz.me/](https://www.xiaoz.me/) 16 | * Q Q:337003006 17 | * E-mail:xiaoz93#outlook.com -------------------------------------------------------------------------------- /static/style.css: -------------------------------------------------------------------------------- 1 | .menu{ 2 | background-color:#393D49; 3 | } 4 | .footer{ 5 | background-color: #2F4056; 6 | position:fixed; 7 | bottom:0; 8 | padding:10px; 9 | color:#DFDFDF; 10 | width:100%; 11 | } 12 | .footer a{ 13 | color:#DFDFDF; 14 | } 15 | .content{ 16 | margin-top:40px; 17 | 18 | } 19 | #ipinfo{ 20 | display: none; 21 | box-shadow: 1px 1px 1px 1px #888888; 22 | margin-top:40px; 23 | } 24 | #allinfo{ 25 | display: none; 26 | margin-top:40px; 27 | } 28 | #myip{ 29 | text-align:center; 30 | margin-top:80px; 31 | } 32 | #myip h3{ 33 | margin-top:10px; 34 | } 35 | #myip code{ 36 | background-color:#F0F0F0; 37 | color:#C13; 38 | } 39 | .logo{ 40 | float:left; 41 | margin-top:5px; 42 | } 43 | .logo img{ 44 | width:150px; 45 | height:49px; 46 | } 47 | .themenu{ 48 | float:left; 49 | } 50 | .right{ 51 | float:right; 52 | } 53 | #loading{ 54 | display: none; 55 | } -------------------------------------------------------------------------------- /layui/css/modules/code.css: -------------------------------------------------------------------------------- 1 | /** layui-v2.2.5 MIT License By https://www.layui.com */ 2 | html #layuicss-skincodecss{display:none;position:absolute;width:1989px}.layui-code-h3,.layui-code-view{position:relative;font-size:12px}.layui-code-view{display:block;margin:10px 0;padding:0;border:1px solid #e2e2e2;border-left-width:6px;background-color:#F2F2F2;color:#333;font-family:Courier New}.layui-code-h3{padding:0 10px;height:32px;line-height:32px;border-bottom:1px solid #e2e2e2}.layui-code-h3 a{position:absolute;right:10px;top:0;color:#999}.layui-code-view .layui-code-ol{position:relative;overflow:auto}.layui-code-view .layui-code-ol li{position:relative;margin-left:45px;line-height:20px;padding:0 5px;border-left:1px solid #e2e2e2;list-style-type:decimal-leading-zero;*list-style-type:decimal;background-color:#fff}.layui-code-view pre{margin:0}.layui-code-notepad{border:1px solid #0C0C0C;border-left-color:#3F3F3F;background-color:#0C0C0C;color:#C2BE9E}.layui-code-notepad .layui-code-h3{border-bottom:none}.layui-code-notepad .layui-code-ol li{background-color:#3F3F3F;border-left:none} -------------------------------------------------------------------------------- /layui/lay/modules/code.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.2.5 MIT License By https://www.layui.com */ 2 | ;layui.define("jquery",function(e){"use strict";var a=layui.$,l="http://www.layui.com/doc/modules/code.html";e("code",function(e){var t=[];e=e||{},e.elem=a(e.elem||".layui-code"),e.about=!("about"in e)||e.about,e.elem.each(function(){t.push(this)}),layui.each(t.reverse(),function(t,i){var c=a(i),o=c.html();(c.attr("lay-encode")||e.encode)&&(o=o.replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""")),c.html('
  1. '+o.replace(/[\r\t\n]+/g,"
  2. ")+"
"),c.find(">.layui-code-h3")[0]||c.prepend('

'+(c.attr("lay-title")||e.title||"code")+(e.about?'layui.code':"")+"

");var d=c.find(">.layui-code-ol");c.addClass("layui-box layui-code-view"),(c.attr("lay-skin")||e.skin)&&c.addClass("layui-code-"+(c.attr("lay-skin")||e.skin)),(d.find("li").length/100|0)>0&&d.css("margin-left",(d.find("li").length/100|0)+"px"),(c.attr("lay-height")||e.height)&&d.css("max-height",c.attr("lay-height")||e.height)})})}).addcss("modules/code.css","skincodecss"); -------------------------------------------------------------------------------- /static/about.html: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 关于 - IPinfo 6 | 7 | 8 | 9 | 10 | 18 | 19 | 20 |
21 |

IPinfo

22 |

IPinfo是一个聚合多接口的IP地址查询工具,接口包括ipip.net、淘宝、新浪、GeoIP等。

23 |
24 |
25 |

安装

26 |

IPinfo完全开源,您可以访问Github:https://github.com/helloxz/IPinfo获取源码并放到PHP环境中运行。

27 |
28 |
29 |

联系我

30 |

31 |

36 |

37 |
38 |
39 |

赞助

40 |

为了IPinfo持续发展,您可以通过扫描下方二维码来赞助。

41 |

42 |
43 | 44 | -------------------------------------------------------------------------------- /layui/lay/modules/laytpl.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.2.5 MIT License By https://www.layui.com */ 2 | ;layui.define(function(e){"use strict";var r={open:"{{",close:"}}"},c={exp:function(e){return new RegExp(e,"g")},query:function(e,c,t){var o=["#([\\s\\S])+?","([^{#}])*?"][e||0];return n((c||"")+r.open+o+r.close+(t||""))},escape:function(e){return String(e||"").replace(/&(?!#?[a-zA-Z0-9]+;)/g,"&").replace(//g,">").replace(/'/g,"'").replace(/"/g,""")},error:function(e,r){var c="Laytpl Error:";return"object"==typeof console&&console.error(c+e+"\n"+(r||"")),c+e}},n=c.exp,t=function(e){this.tpl=e};t.pt=t.prototype,window.errors=0,t.pt.parse=function(e,t){var o=this,p=e,a=n("^"+r.open+"#",""),l=n(r.close+"$","");e=e.replace(/\s+|\r|\t|\n/g," ").replace(n(r.open+"#"),r.open+"# ").replace(n(r.close+"}"),"} "+r.close).replace(/\\/g,"\\\\").replace(n(r.open+"!(.+?)!"+r.close),function(e){return e=e.replace(n("^"+r.open+"!"),"").replace(n("!"+r.close),"").replace(n(r.open+"|"+r.close),function(e){return e.replace(/(.)/g,"\\$1")})}).replace(/(?="|')/g,"\\").replace(c.query(),function(e){return e=e.replace(a,"").replace(l,""),'";'+e.replace(/\\/g,"")+';view+="'}).replace(c.query(1),function(e){var c='"+(';return e.replace(/\s/g,"")===r.open+r.close?"":(e=e.replace(n(r.open+"|"+r.close),""),/^=/.test(e)&&(e=e.replace(/^=/,""),c='"+_escape_('),c+e.replace(/\\/g,"")+')+"')}),e='"use strict";var view = "'+e+'";return view;';try{return o.cache=e=new Function("d, _escape_",e),e(t,c.escape)}catch(u){return delete o.cache,c.error(u,p)}},t.pt.render=function(e,r){var n,t=this;return e?(n=t.cache?t.cache(e,c.escape):t.parse(t.tpl,e),r?void r(n):n):c.error("no data")};var o=function(e){return"string"!=typeof e?c.error("Template not found"):new t(e)};o.config=function(e){e=e||{};for(var c in e)r[c]=e[c]},o.v="1.2.0",e("laytpl",o)}); -------------------------------------------------------------------------------- /layui/lay/modules/flow.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.2.5 MIT License By https://www.layui.com */ 2 | ;layui.define("jquery",function(e){"use strict";var l=layui.$,o=function(e){},t='';o.prototype.load=function(e){var o,i,n,r,a=this,c=0;e=e||{};var f=l(e.elem);if(f[0]){var m=l(e.scrollElem||document),u=e.mb||50,s=!("isAuto"in e)||e.isAuto,v=e.end||"没有更多了",y=e.scrollElem&&e.scrollElem!==document,d="加载更多",h=l('
'+d+"
");f.find(".layui-flow-more")[0]||f.append(h);var p=function(e,t){e=l(e),h.before(e),t=0==t||null,t?h.html(v):h.find("a").html(d),i=t,o=null,n&&n()},g=function(){o=!0,h.find("a").html(t),"function"==typeof e.done&&e.done(++c,p)};if(g(),h.find("a").on("click",function(){l(this);i||o||g()}),e.isLazyimg)var n=a.lazyimg({elem:e.elem+" img",scrollElem:e.scrollElem});return s?(m.on("scroll",function(){var e=l(this),t=e.scrollTop();r&&clearTimeout(r),i||(r=setTimeout(function(){var i=y?e.height():l(window).height(),n=y?e.prop("scrollHeight"):document.documentElement.scrollHeight;n-t-i<=u&&(o||g())},100))}),a):a}},o.prototype.lazyimg=function(e){var o,t=this,i=0;e=e||{};var n=l(e.scrollElem||document),r=e.elem||"img",a=e.scrollElem&&e.scrollElem!==document,c=function(e,l){var o=n.scrollTop(),r=o+l,c=a?function(){return e.offset().top-n.offset().top+o}():e.offset().top;if(c>=o&&c<=r&&!e.attr("src")){var m=e.attr("lay-src");layui.img(m,function(){var l=t.lazyimg.elem.eq(i);e.attr("src",m).removeAttr("lay-src"),l[0]&&f(l),i++})}},f=function(e,o){var f=a?(o||n).height():l(window).height(),m=n.scrollTop(),u=m+f;if(t.lazyimg.elem=l(r),e)c(e,f);else for(var s=0;su)break}};if(f(),!o){var m;n.on("scroll",function(){var e=l(this);m&&clearTimeout(m),m=setTimeout(function(){f(null,e)},50)}),o=!0}return f},e("flow",new o)}); -------------------------------------------------------------------------------- /layui/lay/modules/util.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.2.5 MIT License By https://www.layui.com */ 2 | ;layui.define("jquery",function(e){"use strict";var t=layui.$,i={fixbar:function(e){var i,o,a="layui-fixbar",r="layui-fixbar-top",n=t(document),l=t("body");e=t.extend({showHeight:200},e),e.bar1=e.bar1===!0?"":e.bar1,e.bar2=e.bar2===!0?"":e.bar2,e.bgcolor=e.bgcolor?"background-color:"+e.bgcolor:"";var c=[e.bar1,e.bar2,""],g=t(['"].join("")),s=g.find("."+r),u=function(){var t=n.scrollTop();t>=e.showHeight?i||(s.show(),i=1):i&&(s.hide(),i=0)};t("."+a)[0]||("object"==typeof e.css&&g.css(e.css),l.append(g),u(),g.find("li").on("click",function(){var i=t(this),o=i.attr("lay-type");"top"===o&&t("html,body").animate({scrollTop:0},200),e.click&&e.click.call(this,o)}),n.on("scroll",function(){clearTimeout(o),o=setTimeout(function(){u()},100)}))},countdown:function(e,t,i){var o=this,a="function"==typeof t,r=new Date(e).getTime(),n=new Date(!t||a?(new Date).getTime():t).getTime(),l=r-n,c=[Math.floor(l/864e5),Math.floor(l/36e5)%24,Math.floor(l/6e4)%60,Math.floor(l/1e3)%60];a&&(i=t);var g=setTimeout(function(){o.countdown(e,n+1e3,i)},1e3);return i&&i(l>0?c:[0,0,0,0],t,g),l<=0&&clearTimeout(g),g},timeAgo:function(e,t){var i=this,o=[[],[]],a=(new Date).getTime()-new Date(e).getTime();return a>6912e5?(a=new Date(e),o[0][0]=i.digit(a.getFullYear(),4),o[0][1]=i.digit(a.getMonth()+1),o[0][2]=i.digit(a.getDate()),t||(o[1][0]=i.digit(a.getHours()),o[1][1]=i.digit(a.getMinutes()),o[1][2]=i.digit(a.getSeconds())),o[0].join("-")+" "+o[1].join(":")):a>=864e5?(a/1e3/60/60/24|0)+"天前":a>=36e5?(a/1e3/60/60|0)+"小时前":a>=12e4?(a/1e3/60|0)+"分钟前":a<0?"未来":"刚刚"},digit:function(e,t){var i="";e=String(e),t=t||2;for(var o=e.length;o0,c=o(''),s=o(["
  • ",function(){return l?''+(n.spread?t.arrow[1]:t.arrow[0])+"":""}(),function(){return r.check?''+("checkbox"===r.check?t.checkbox[0]:"radio"===r.check?t.radio[0]:"")+"":""}(),function(){return'"+(''+(l?n.spread?t.branch[1]:t.branch[0]:t.leaf)+"")+(""+(n.name||"未命名")+"")}(),"
  • "].join(""));l&&(s.append(c),i.tree(c,n.children)),e.append(s),"function"==typeof r.click&&i.click(s,n),i.spread(s,n),r.drag&&i.drag(s,n)})},r.prototype.click=function(e,o){var a=this,i=a.options;e.children("a").on("click",function(e){layui.stope(e),i.click(o)})},r.prototype.spread=function(e,o){var a=this,i=(a.options,e.children(".layui-tree-spread")),r=e.children("ul"),n=e.children("a"),l=function(){e.data("spread")?(e.data("spread",null),r.removeClass("layui-show"),i.html(t.arrow[0]),n.find(".layui-icon").html(t.branch[0])):(e.data("spread",!0),r.addClass("layui-show"),i.html(t.arrow[1]),n.find(".layui-icon").html(t.branch[1]))};r[0]&&(i.on("click",l),n.on("dblclick",l))},r.prototype.on=function(e){var a=this,r=a.options,t="layui-tree-drag";e.find("i").on("selectstart",function(e){return!1}),r.drag&&o(document).on("mousemove",function(e){var i=a.move;if(i.from){var r=(i.to,o('
    '));e.preventDefault(),o("."+t)[0]||o("body").append(r);var n=o("."+t)[0]?o("."+t):r;n.addClass("layui-show").html(i.from.elem.children("a").html()),n.css({left:e.pageX+10,top:e.pageY+10})}}).on("mouseup",function(){var e=a.move;e.from&&(e.from.elem.children("a").removeClass(i),e.to&&e.to.elem.children("a").removeClass(i),a.move={},o("."+t).remove())})},r.prototype.move={},r.prototype.drag=function(e,a){var r=this,t=(r.options,e.children("a")),n=function(){var t=o(this),n=r.move;n.from&&(n.to={item:a,elem:e},t.addClass(i))};t.on("mousedown",function(){var o=r.move;o.from={item:a,elem:e}}),t.on("mouseenter",n).on("mousemove",n).on("mouseleave",function(){var e=o(this),a=r.move;a.from&&(delete a.to,e.removeClass(i))})},e("tree",function(e){var i=new r(e=e||{}),t=o(e.elem);return t[0]?void i.init(t):a.error("layui.tree 没有找到"+e.elem+"元素")})}); -------------------------------------------------------------------------------- /AllInfo.php: -------------------------------------------------------------------------------- 1 | "http://freeapi.ipip.net/","taobao" => "http://ip.taobao.com/service/getIpInfo.php?ip=","sina" => "http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=json&ip=","geoip" => "https://api.ip.sb/geoip/"); 5 | 6 | $ip = $_GET['ip']; //获取IP 7 | $ip = geturl($ip); //对域名进行解析并判断IP 8 | //组合后得到完整的API地址 9 | //$fullurl = $apiurl[$type].$ip; 10 | 11 | //遍历一次API得到所有json数据 12 | foreach( $apiurl as $key => $apitype ) 13 | { 14 | $curl = curl_init($apitype.$ip); 15 | 16 | curl_setopt($curl, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 Safari/537.36"); 17 | curl_setopt($curl, CURLOPT_FAILONERROR, true); 18 | curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); 19 | curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); 20 | curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); 21 | curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); 22 | 23 | $reinfo[$key] = curl_exec($curl); 24 | curl_close($curl); 25 | //echo $reinfo['ipip']; 26 | 27 | } 28 | $ipip = ipip($reinfo['ipip']); 29 | //echo $reinfo['taobao']; 30 | $taobao = taobao($reinfo['taobao']); 31 | $sina = sina($reinfo['sina']); 32 | $geoip = geoip($reinfo['geoip']); 33 | 34 | $alldata = array( 35 | "status" => 1, 36 | "ip" => $ip, 37 | "ipip" => $ipip, 38 | "taobao" => $taobao, 39 | "sina" => $sina, 40 | "geoip" => $geoip 41 | ); 42 | $alldata = json_encode($alldata); 43 | echo $alldata; 44 | exit; 45 | 46 | //域名解析为ip 47 | function geturl($url){ 48 | $domain = parse_url($url); 49 | //主机名不存在,可能是IP 50 | if(!$domain['host']) { 51 | //如果是IP 52 | if(filter_var($url, FILTER_VALIDATE_IP)) { 53 | $ip = $url; 54 | }//如果不是IP,可能是一个域名 55 | else{ 56 | $ip = gethostbyname($url); 57 | } 58 | }//是一个URL 59 | else{ 60 | $domain = $domain['host']; 61 | $ip = gethostbyname($domain); 62 | } 63 | //echo $domain; 64 | //最后返回解析后的IP 65 | if(filter_var($ip, FILTER_VALIDATE_IP)) { 66 | return $ip; 67 | } 68 | else{ 69 | $ipinfo = array( 70 | "status" => 0, 71 | "msg" => "不是一个有效的IP或域名!" 72 | ); 73 | echo json_encode($ipinfo); 74 | exit; 75 | } 76 | } 77 | //获取ipip.net返回数据 78 | function ipip($apijson){ 79 | //echo $apijson; 80 | $ipip = json_decode($apijson); 81 | $ipip = $ipip[0]." ".$ipip[1]." ".$ipip[2]." ".$ipip[3]." ".$ipip[4]; 82 | return $ipip; 83 | } 84 | //获取淘宝返回数据 85 | function taobao($apijson) { 86 | $taobao = json_decode($apijson); 87 | $taobao = $taobao->data; 88 | //var_dump($taobao); 89 | $taobao = $taobao->country." ".$taobao->region." ".$taobao->city." ".$taobao->county." ".$taobao->isp; 90 | return $taobao; 91 | } 92 | //获取新浪数据 93 | function sina($apijson) { 94 | $sina = json_decode($apijson); 95 | $sina = $sina->country." ".$sina->province." ".$sina->city." ".$sina->district." ".$sina->isp; 96 | return $sina; 97 | } 98 | //获取geoip 99 | function geoip($apijson){ 100 | $geoip = json_decode($apijson); 101 | $geoip = $geoip->country." ".$geoip->region." ".$geoip->city." ".$geoip->organization; 102 | return $geoip; 103 | } 104 | ?> -------------------------------------------------------------------------------- /layui/lay/modules/carousel.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.2.5 MIT License By https://www.layui.com */ 2 | ;layui.define("jquery",function(e){"use strict";var i=layui.$,n=(layui.hint(),layui.device(),{config:{},set:function(e){var n=this;return n.config=i.extend({},n.config,e),n},on:function(e,i){return layui.onevent.call(this,t,e,i)}}),t="carousel",a="layui-this",l=">*[carousel-item]>*",o="layui-carousel-left",r="layui-carousel-right",d="layui-carousel-prev",s="layui-carousel-next",u="layui-carousel-arrow",c="layui-carousel-ind",m=function(e){var t=this;t.config=i.extend({},t.config,n.config,e),t.render()};m.prototype.config={width:"600px",height:"280px",full:!1,arrow:"hover",indicator:"inside",autoplay:!0,interval:3e3,anim:"",trigger:"click",index:0},m.prototype.render=function(){var e=this,n=e.config;n.elem=i(n.elem),n.elem[0]&&(e.elemItem=n.elem.find(l),n.index<0&&(n.index=0),n.index>=e.elemItem.length&&(n.index=e.elemItem.length-1),n.interval<800&&(n.interval=800),n.full?n.elem.css({position:"fixed",width:"100%",height:"100%",zIndex:9999}):n.elem.css({width:n.width,height:n.height}),n.elem.attr("lay-anim",n.anim),e.elemItem.eq(n.index).addClass(a),e.elemItem.length<=1||(e.indicator(),e.arrow(),e.autoplay(),e.events()))},m.prototype.reload=function(e){var n=this;clearInterval(n.timer),n.config=i.extend({},n.config,e),n.render()},m.prototype.prevIndex=function(){var e=this,i=e.config,n=i.index-1;return n<0&&(n=e.elemItem.length-1),n},m.prototype.nextIndex=function(){var e=this,i=e.config,n=i.index+1;return n>=e.elemItem.length&&(n=0),n},m.prototype.addIndex=function(e){var i=this,n=i.config;e=e||1,n.index=n.index+e,n.index>=i.elemItem.length&&(n.index=0)},m.prototype.subIndex=function(e){var i=this,n=i.config;e=e||1,n.index=n.index-e,n.index<0&&(n.index=i.elemItem.length-1)},m.prototype.autoplay=function(){var e=this,i=e.config;i.autoplay&&(e.timer=setInterval(function(){e.slide()},i.interval))},m.prototype.arrow=function(){var e=this,n=e.config,t=i(['",'"].join(""));n.elem.attr("lay-arrow",n.arrow),n.elem.find("."+u)[0]&&n.elem.find("."+u).remove(),n.elem.append(t),t.on("click",function(){var n=i(this),t=n.attr("lay-type");e.slide(t)})},m.prototype.indicator=function(){var e=this,n=e.config,t=e.elemInd=i(['
      ',function(){var i=[];return layui.each(e.elemItem,function(e){i.push("")}),i.join("")}(),"
    "].join(""));n.elem.attr("lay-indicator",n.indicator),n.elem.find("."+c)[0]&&n.elem.find("."+c).remove(),n.elem.append(t),"updown"===n.anim&&t.css("margin-top",-(t.height()/2)),t.find("li").on("hover"===n.trigger?"mouseover":n.trigger,function(){var t=i(this),a=t.index();a>n.index?e.slide("add",a-n.index):aa.pages&&(a.curr=a.pages),t<0?t=1:t>a.pages&&(t=a.pages),a.prev="prev"in a?a.prev:"上一页",a.next="next"in a?a.next:"下一页";var n=a.pages>t?Math.ceil((a.curr+(t>1?1:0))/(t>0?t:1)):1,i={prev:function(){return a.prev?''+a.prev+"":""}(),page:function(){var e=[];if(a.count<1)return"";n>1&&a.first!==!1&&0!==t&&e.push(''+(a.first||1)+"");var i=Math.floor((t-1)/2),r=n>1?a.curr-i:1,u=n>1?function(){var e=a.curr+(t-i-1);return e>a.pages?a.pages:e}():t;for(u-r2&&e.push('');r<=u;r++)r===a.curr?e.push('"+r+""):e.push(''+r+"");return a.pages>t&&a.pages>u&&a.last!==!1&&(u+1…'),0!==t&&e.push(''+(a.last||a.pages)+"")),e.join("")}(),next:function(){return a.next?''+a.next+"":""}(),count:'共 '+a.count+" 条",limit:function(){var e=['"}(),skip:function(){return['到第','','页',""].join("")}()};return['
    ',function(){var e=[];return layui.each(a.layout,function(a,t){i[t]&&e.push(i[t])}),e.join("")}(),"
    "].join("")},u.prototype.jump=function(e,a){if(e){var t=this,i=t.config,r=e.children,u=e[n]("button")[0],l=e[n]("input")[0],p=e[n]("select")[0],c=function(){var e=0|l.value.replace(/\s|\D/g,"");e&&(i.curr=e,t.render())};if(a)return c();for(var o=0,y=r.length;oi.pages||(i.curr=e,t.render())});p&&s.on(p,"change",function(){var e=this.value;i.curr*e>i.count&&(i.curr=Math.ceil(i.count/e)),i.limit=e,t.render()}),u&&s.on(u,"click",function(){c()})}},u.prototype.skip=function(e){if(e){var a=this,t=e[n]("input")[0];t&&s.on(t,"keyup",function(t){var n=this.value,i=t.keyCode;/^(37|38|39|40)$/.test(i)||(/\D/.test(n)&&(this.value=n.replace(/\D/,"")),13===i&&a.jump(e,!0))})}},u.prototype.render=function(e){var n=this,i=n.config,r=n.type(),u=n.view();2===r?i.elem&&(i.elem.innerHTML=u):3===r?i.elem.html(u):a[t](i.elem)&&(a[t](i.elem).innerHTML=u),i.jump&&i.jump(i,e);var s=a[t]("layui-laypage-"+i.index);n.jump(s),i.hash&&!e&&(location.hash="!"+i.hash+"="+i.curr),n.skip(s)};var s={render:function(e){var a=new u(e);return a.index},index:layui.laypage?layui.laypage.index+1e4:0,on:function(e,a,t){return e.attachEvent?e.attachEvent("on"+a,function(a){a.target=a.srcElement,t.call(e,a)}):e.addEventListener(a,t,!1),this}};e(i,s)}); -------------------------------------------------------------------------------- /GetInfo.php: -------------------------------------------------------------------------------- 1 | "http://freeapi.ipip.net/","ipip" => "http://freeapi.ipip.net/","taobao" => "http://ip.taobao.com/service/getIpInfo.php?ip=","sina" => "http://int.dpool.sina.com.cn/iplookup/iplookup.php?format=json&ip=","geoip" => "https://api.ip.sb/geoip/"); 5 | $type = $_GET['type']; //获取接口类型 6 | $ip = $_GET['ip']; //获取IP 7 | $ip = geturl($ip); //对域名进行解析并判断IP 8 | //对IP进行判断 9 | //$isip = filter_var($ip, FILTER_VALIDATE_IP); 10 | //if((!isset($ip)) || !$isip) { 11 | // echo 'IP格式有误'; 12 | // exit; 13 | //} 14 | $fullurl = $apiurl[$type].$ip; 15 | 16 | queryip($ip,$type,$fullurl); 17 | 18 | function queryip($ip,$type,$fullurl){ 19 | $curl = curl_init($fullurl); 20 | 21 | curl_setopt($curl, CURLOPT_USERAGENT, "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.186 Safari/537.36"); 22 | curl_setopt($curl, CURLOPT_FAILONERROR, true); 23 | curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); 24 | curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); 25 | curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false); 26 | curl_setopt($curl, CURLOPT_SSL_VERIFYHOST, false); 27 | 28 | $reinfo = curl_exec($curl); 29 | curl_close($curl); 30 | //echo $reinfo; 31 | switch ( $type ) 32 | { 33 | //返回默认数据 34 | case 'default': 35 | $ipinfo = json_decode($reinfo); 36 | $ipinfo = array("status" => 1,"ip" => $ip,"country" => $ipinfo[0],"region" => $ipinfo[1],"city" => $ipinfo[2],"county" => $ipinfo[3],"isp" => $ipinfo[4]); 37 | $ipinfo = json_encode($ipinfo); 38 | echo $ipinfo; 39 | break; 40 | //返回淘宝数据 41 | //返回ipip.net数据 42 | case 'ipip': 43 | $ipinfo = json_decode($reinfo); 44 | $ipinfo = array("status" => 1,"ip" => $ip,"country" => $ipinfo[0],"region" => $ipinfo[1],"city" => $ipinfo[2],"county" => $ipinfo[3],"isp" => $ipinfo[4]); 45 | $ipinfo = json_encode($ipinfo); 46 | echo $ipinfo; 47 | break; 48 | //返回淘宝数据 49 | case 'taobao': 50 | $ipinfo = json_decode($reinfo); 51 | $ipinfo = $ipinfo->data; 52 | $ipinfo->county = str_replace("X","",$ipinfo->county); 53 | $ipinfo = array( 54 | "status" => 1, 55 | "ip" => $ip, 56 | "country" => $ipinfo->country, 57 | "region" => $ipinfo->region, 58 | "city" => $ipinfo->city, 59 | "county" => $ipinfo->county, 60 | "isp" => $ipinfo->isp 61 | ); 62 | $ipinfo = json_encode($ipinfo); 63 | echo $ipinfo; 64 | break; 65 | //返回新浪数据 66 | case 'sina': 67 | $ipinfo = json_decode($reinfo); 68 | //print_r($ipinfo); 69 | //exit; 70 | $ipinfo = array( 71 | "status" => 1, 72 | "ip" => $ip, 73 | "country" => $ipinfo->country, 74 | "region" => $ipinfo->province, 75 | "city" => $ipinfo->city, 76 | "county" => $ipinfo->district, 77 | "isp" => $ipinfo->isp 78 | ); 79 | $ipinfo = json_encode($ipinfo); 80 | echo $ipinfo; 81 | break; 82 | //返回GEOIP数据 83 | case 'geoip': 84 | $ipinfo = json_decode($reinfo); 85 | $ipinfo = array( 86 | "status" => 1, 87 | "ip" => $ip, 88 | "country" => $ipinfo->country, 89 | "region" => $ipinfo->region, 90 | "city" => $ipinfo->city, 91 | "county" => "", 92 | "isp" => $ipinfo->organization 93 | ); 94 | $ipinfo = json_encode($ipinfo); 95 | echo $ipinfo; 96 | break; 97 | default: 98 | $ipinfo = array( 99 | "status" => 0, 100 | "msg" => "未识别的接口!" 101 | ); 102 | echo json_encode($ipinfo); 103 | break; 104 | } 105 | } 106 | 107 | //域名解析为ip 108 | function geturl($url){ 109 | $domain = parse_url($url); 110 | //主机名不存在,可能是IP 111 | if(!$domain['host']) { 112 | //如果是IP 113 | if(filter_var($url, FILTER_VALIDATE_IP)) { 114 | $ip = $url; 115 | }//如果不是IP,可能是一个域名 116 | else{ 117 | $ip = gethostbyname($url); 118 | } 119 | }//是一个URL 120 | else{ 121 | $domain = $domain['host']; 122 | $ip = gethostbyname($domain); 123 | } 124 | //echo $domain; 125 | //最后返回解析后的IP 126 | if(filter_var($ip, FILTER_VALIDATE_IP)) { 127 | return $ip; 128 | } 129 | else{ 130 | $ipinfo = array( 131 | "status" => 0, 132 | "msg" => "不是一个有效的IP或域名!" 133 | ); 134 | echo json_encode($ipinfo); 135 | exit; 136 | } 137 | } 138 | ?> -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | 4 | 5 | 6 | 7 | 8 | 整合多接口的IP地址查询工具 - IPInfo 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 42 | 43 | 44 |
    45 |
    46 |
    47 | 48 | 49 | 50 | 53 | 63 | 64 | 65 | 66 |
    51 | 52 | 54 | 62 |
    67 |
    68 |
    69 |

    内网IP:

    70 |

    公网IP:

    71 |
    72 | 73 |
    74 |

    来自 的数据

    75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 |
    IP国家区/县运营商
    105 |
    106 | 107 | 108 |
    109 |

    查询结果

    110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | 138 | 139 |
    数据来源地区/运营商
    IPIP.NET
    淘宝
    新浪
    GeoIP
    140 |
    141 | 142 |
    143 |
    144 |
    145 | 146 | 147 | 156 | 157 | 158 | 159 | 160 | 161 | -------------------------------------------------------------------------------- /layui/layui.js: -------------------------------------------------------------------------------- 1 | /** layui-v2.2.5 MIT License By https://www.layui.com */ 2 | ;!function(e){"use strict";var t=document,n={modules:{},status:{},timeout:10,event:{}},o=function(){this.v="2.2.5"},r=function(){var e=t.currentScript?t.currentScript.src:function(){for(var e,n=t.scripts,o=n.length-1,r=o;r>0;r--)if("interactive"===n[r].readyState){e=n[r].src;break}return e||n[o].src}();return e.substring(0,e.lastIndexOf("/")+1)}(),a=function(t){e.console&&console.error&&console.error("Layui hint: "+t)},i="undefined"!=typeof opera&&"[object Opera]"===opera.toString(),u={layer:"modules/layer",laydate:"modules/laydate",laypage:"modules/laypage",laytpl:"modules/laytpl",layim:"modules/layim",layedit:"modules/layedit",form:"modules/form",upload:"modules/upload",tree:"modules/tree",table:"modules/table",element:"modules/element",util:"modules/util",flow:"modules/flow",carousel:"modules/carousel",code:"modules/code",jquery:"modules/jquery",mobile:"modules/mobile","layui.all":"../layui.all"};o.prototype.cache=n,o.prototype.define=function(e,t){var o=this,r="function"==typeof e,a=function(){var e=function(e,t){layui[e]=t,n.status[e]=!0};return"function"==typeof t&&t(function(o,r){e(o,r),n.callback[o]=function(){t(e)}}),this};return r&&(t=e,e=[]),layui["layui.all"]||!layui["layui.all"]&&layui["layui.mobile"]?a.call(o):(o.use(e,a),o)},o.prototype.use=function(e,o,l){function s(e,t){var o="PLaySTATION 3"===navigator.platform?/^complete$/:/^(complete|loaded)$/;("load"===e.type||o.test((e.currentTarget||e.srcElement).readyState))&&(n.modules[f]=t,d.removeChild(v),function r(){return++m>1e3*n.timeout/4?a(f+" is not a valid module"):void(n.status[f]?c():setTimeout(r,4))}())}function c(){l.push(layui[f]),e.length>1?y.use(e.slice(1),o,l):"function"==typeof o&&o.apply(layui,l)}var y=this,p=n.dir=n.dir?n.dir:r,d=t.getElementsByTagName("head")[0];e="string"==typeof e?[e]:e,window.jQuery&&jQuery.fn.on&&(y.each(e,function(t,n){"jquery"===n&&e.splice(t,1)}),layui.jquery=layui.$=jQuery);var f=e[0],m=0;if(l=l||[],n.host=n.host||(p.match(/\/\/([\s\S]+?)\//)||["//"+location.host+"/"])[0],0===e.length||layui["layui.all"]&&u[f]||!layui["layui.all"]&&layui["layui.mobile"]&&u[f])return c(),y;if(n.modules[f])!function g(){return++m>1e3*n.timeout/4?a(f+" is not a valid module"):void("string"==typeof n.modules[f]&&n.status[f]?c():setTimeout(g,4))}();else{var v=t.createElement("script"),h=(u[f]?p+"lay/":/^\{\/\}/.test(y.modules[f])?"":n.base||"")+(y.modules[f]||f)+".js";h=h.replace(/^\{\/\}/,""),v.async=!0,v.charset="utf-8",v.src=h+function(){var e=n.version===!0?n.v||(new Date).getTime():n.version||"";return e?"?v="+e:""}(),d.appendChild(v),!v.attachEvent||v.attachEvent.toString&&v.attachEvent.toString().indexOf("[native code")<0||i?v.addEventListener("load",function(e){s(e,h)},!1):v.attachEvent("onreadystatechange",function(e){s(e,h)}),n.modules[f]=h}return y},o.prototype.getStyle=function(t,n){var o=t.currentStyle?t.currentStyle:e.getComputedStyle(t,null);return o[o.getPropertyValue?"getPropertyValue":"getAttribute"](n)},o.prototype.link=function(e,o,r){var i=this,u=t.createElement("link"),l=t.getElementsByTagName("head")[0];"string"==typeof o&&(r=o);var s=(r||e).replace(/\.|\//g,""),c=u.id="layuicss-"+s,y=0;return u.rel="stylesheet",u.href=e+(n.debug?"?v="+(new Date).getTime():""),u.media="all",t.getElementById(c)||l.appendChild(u),"function"!=typeof o?i:(function p(){return++y>1e3*n.timeout/100?a(e+" timeout"):void(1989===parseInt(i.getStyle(t.getElementById(c),"width"))?function(){o()}():setTimeout(p,100))}(),i)},n.callback={},o.prototype.factory=function(e){if(layui[e])return"function"==typeof n.callback[e]?n.callback[e]:null},o.prototype.addcss=function(e,t,o){return layui.link(n.dir+"css/"+e,t,o)},o.prototype.img=function(e,t,n){var o=new Image;return o.src=e,o.complete?t(o):(o.onload=function(){o.onload=null,t(o)},void(o.onerror=function(e){o.onerror=null,n(e)}))},o.prototype.config=function(e){e=e||{};for(var t in e)n[t]=e[t];return this},o.prototype.modules=function(){var e={};for(var t in u)e[t]=u[t];return e}(),o.prototype.extend=function(e){var t=this;e=e||{};for(var n in e)t[n]||t.modules[n]?a("模块名 "+n+" 已被占用"):t.modules[n]=e[n];return t},o.prototype.router=function(e){var t=this,e=e||location.hash,n={path:[],search:{},hash:(e.match(/[^#](#.*$)/)||[])[1]||""};return/^#\//.test(e)?(n.href=e=e.replace(/^#\//,""),e=e.replace(/([^#])(#.*$)/,"$1").split("/")||[],t.each(e,function(e,t){/^\w+=/.test(t)?function(){t=t.split("="),n.search[t[0]]=t[1]}():n.path.push(t)}),n):n},o.prototype.data=function(t,n,o){if(t=t||"layui",o=o||localStorage,e.JSON&&e.JSON.parse){if(null===n)return delete o[t];n="object"==typeof n?n:{key:n};try{var r=JSON.parse(o[t])}catch(a){var r={}}return"value"in n&&(r[n.key]=n.value),n.remove&&delete r[n.key],o[t]=JSON.stringify(r),n.key?r[n.key]:r}},o.prototype.sessionData=function(e,t){return this.data(e,t,sessionStorage)},o.prototype.device=function(t){var n=navigator.userAgent.toLowerCase(),o=function(e){var t=new RegExp(e+"/([^\\s\\_\\-]+)");return e=(n.match(t)||[])[1],e||!1},r={os:function(){return/windows/.test(n)?"windows":/linux/.test(n)?"linux":/iphone|ipod|ipad|ios/.test(n)?"ios":/mac/.test(n)?"mac":void 0}(),ie:function(){return!!(e.ActiveXObject||"ActiveXObject"in e)&&((n.match(/msie\s(\d+)/)||[])[1]||"11")}(),weixin:o("micromessenger")};return t&&!r[t]&&(r[t]=o(t)),r.android=/android/.test(n),r.ios="ios"===r.os,r},o.prototype.hint=function(){return{error:a}},o.prototype.each=function(e,t){var n,o=this;if("function"!=typeof t)return o;if(e=e||[],e.constructor===Object){for(n in e)if(t.call(e[n],n,e[n]))break}else for(n=0;na?1:r"].join("")),o=t.elem.next();(o.hasClass(u)||o.hasClass(c))&&o.remove(),a.ie&&a.ie<10&&t.elem.wrap('
    '),e.isFile()?(e.elemFile=t.elem,t.field=t.elem[0].name):t.elem.after(n),a.ie&&a.ie<10&&e.initIE()},p.prototype.initIE=function(){var e=this,t=e.config,n=i(''),a=i(['
    ',"
    "].join(""));i("#"+f)[0]||i("body").append(n),t.elem.next().hasClass(f)||(e.elemFile.wrap(a),t.elem.next("."+f).append(function(){var e=[];return layui.each(t.data,function(i,t){e.push('')}),e.join("")}()))},p.prototype.msg=function(e){return t.msg(e,{icon:2,shift:6})},p.prototype.isFile=function(){var e=this.config.elem[0];if(e)return"input"===e.tagName.toLocaleLowerCase()&&"file"===e.type},p.prototype.preview=function(e){var i=this;window.FileReader&&layui.each(i.chooseFiles,function(i,t){var n=new FileReader;n.readAsDataURL(t),n.onload=function(){e&&e(i,t,this.result)}})},p.prototype.upload=function(e,t){var n,o=this,l=o.config,r=o.elemFile[0],u=function(){var t=0,n=0,a=e||o.files||o.chooseFiles||r.files,u=function(){l.multiple&&t+n===o.fileLength&&"function"==typeof l.allDone&&l.allDone({total:o.fileLength,successful:t,aborted:n})};layui.each(a,function(e,a){var r=new FormData;r.append(l.field,a),layui.each(l.data,function(e,i){r.append(e,i)}),i.ajax({url:l.url,type:l.method,data:r,contentType:!1,processData:!1,dataType:"json",success:function(i){t++,d(e,i),u()},error:function(){n++,o.msg("请求上传接口出现异常"),m(e),u()}})})},c=function(){var e=i("#"+f);o.elemFile.parent().submit(),clearInterval(p.timer),p.timer=setInterval(function(){var i,t=e.contents().find("body");try{i=t.text()}catch(n){o.msg("获取上传后的响应信息出现异常"),clearInterval(p.timer),m()}i&&(clearInterval(p.timer),t.html(""),d(0,i))},30)},d=function(e,i){if(o.elemFile.next("."+s).remove(),r.value="","object"!=typeof i)try{i=JSON.parse(i)}catch(t){return i={},o.msg("请对上传接口返回有效JSON")}"function"==typeof l.done&&l.done(i,e||0,function(e){o.upload(e)})},m=function(e){l.auto&&(r.value=""),"function"==typeof l.error&&l.error(e||0,function(e){o.upload(e)})},h=l.exts,v=function(){var i=[];return layui.each(e||o.chooseFiles,function(e,t){i.push(t.name)}),i}(),g={preview:function(e){o.preview(e)},upload:function(e,i){var t={};t[e]=i,o.upload(t)},pushFile:function(){return o.files=o.files||{},layui.each(o.chooseFiles,function(e,i){o.files[e]=i}),o.files}},y=function(){return"choose"===t?l.choose&&l.choose(g):(l.before&&l.before(g),a.ie?a.ie>9?u():c():void u())};if(v=0===v.length?r.value.match(/[^\/\\]+\..+/g)||[]||"":v,0!==v.length){switch(l.accept){case"file":if(h&&!RegExp("\\w\\.("+h+")$","i").test(escape(v)))return o.msg("选择的文件中包含不支持的格式"),r.value="";break;case"video":if(!RegExp("\\w\\.("+(h||"avi|mp4|wma|rmvb|rm|flash|3gp|flv")+")$","i").test(escape(v)))return o.msg("选择的视频中包含不支持的格式"),r.value="";break;case"audio":if(!RegExp("\\w\\.("+(h||"mp3|wav|mid")+")$","i").test(escape(v)))return o.msg("选择的音频中包含不支持的格式"),r.value="";break;default:if(layui.each(v,function(e,i){RegExp("\\w\\.("+(h||"jpg|png|gif|bmp|jpeg$")+")","i").test(escape(i))||(n=!0)}),n)return o.msg("选择的图片中包含不支持的格式"),r.value=""}if(o.fileLength=function(){var i=0,t=e||o.files||o.chooseFiles||r.files;return layui.each(t,function(){i++}),i}(),l.number&&o.fileLength>l.number)return o.msg("同时最多只能上传的数量为:"+l.number);if(l.size>0&&!(a.ie&&a.ie<10)){var F;if(layui.each(o.chooseFiles,function(e,i){if(i.size>1024*l.size){var t=l.size/1024;t=t>=1?Math.floor(t)+(t%1>0?t.toFixed(1):0)+"MB":l.size+"KB",r.value="",F=t}}),F)return o.msg("文件不能超过"+F)}y()}},p.prototype.events=function(){var e=this,t=e.config,o=function(i){e.chooseFiles={},layui.each(i,function(i,t){var n=(new Date).getTime();e.chooseFiles[n+"-"+i]=t})},l=function(i,n){var a=e.elemFile,o=i.length>1?i.length+"个文件":(i[0]||{}).name||a[0].value.match(/[^\/\\]+\..+/g)||[]||"";a.next().hasClass(s)&&a.next().remove(),e.upload(null,"choose"),e.isFile()||t.choose||a.after(''+o+"")};t.elem.off("upload.start").on("upload.start",function(){var a=i(this),o=a.attr("lay-data");if(o)try{o=new Function("return "+o)(),e.config=i.extend({},t,o)}catch(l){n.error("Upload element property lay-data configuration item has a syntax error: "+o)}e.config.item=a,e.elemFile[0].click()}),a.ie&&a.ie<10||t.elem.off("upload.over").on("upload.over",function(){var e=i(this);e.attr("lay-over","")}).off("upload.leave").on("upload.leave",function(){var e=i(this);e.removeAttr("lay-over")}).off("upload.drop").on("upload.drop",function(n,a){var r=i(this),u=a.originalEvent.dataTransfer.files||[];r.removeAttr("lay-over"),o(u),t.auto?e.upload(u):l(u)}),e.elemFile.off("upload.change").on("upload.change",function(){var i=this.files||[];o(i),t.auto?e.upload():l(i)}),t.bindAction.off("upload.action").on("upload.action",function(){e.upload()}),t.elem.data("haveEvents")||(e.elemFile.on("change",function(){i(this).trigger("upload.change")}),t.elem.on("click",function(){e.isFile()||i(this).trigger("upload.start")}),t.drag&&t.elem.on("dragover",function(e){e.preventDefault(),i(this).trigger("upload.over")}).on("dragleave",function(e){i(this).trigger("upload.leave")}).on("drop",function(e){e.preventDefault(),i(this).trigger("upload.drop",e)}),t.bindAction.on("click",function(){i(this).trigger("upload.action")}),t.elem.data("haveEvents",!0))},o.render=function(e){var i=new p(e);return l.call(i)},e(r,o)}); -------------------------------------------------------------------------------- /static/embed.js: -------------------------------------------------------------------------------- 1 | layui.use(['layer', 'form'], function(){ 2 | var form = layui.form; 3 | var layer = layui.layer; 4 | //各种基于事件的操作,下面会有进一步介绍 5 | }); 6 | $(document).ready(function(){ 7 | //访问页面时加载 8 | var getip = $("#getip").text(); 9 | $.get("./GetInfo.php?type=taobao"+"&ip="+getip,function(data,status){ 10 | if(status == 'success') { 11 | var myip = eval('(' + data + ')'); 12 | $("#myip").append("

    " + myip.country + myip.region + myip.city + myip.county + myip.isp + "

    "); 13 | } 14 | }); 15 | $("#btn").click(function(){ 16 | $("#myip").hide(); 17 | $("#ipinfo").hide(); 18 | $("#allinfo").hide(); 19 | $("#loading").show(); 20 | 21 | var ip = $("#ip").val(); 22 | ip = ip.replace(/ /g,""); //替换空字符 23 | var type = $("#type").val(); 24 | //判断IP是否为真 25 | //var reg = /^(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])\.(\d{1,2}|1\d\d|2[0-4]\d|25[0-5])$/ 26 | //if(!reg.test(ip)) { 27 | // layer.open({ 28 | // title: '错误提示' 29 | // ,content: 'IP格式有误!', 30 | // time:2000 31 | // }); 32 | // return false; 33 | //} 34 | //判断接口类型 35 | switch(type) { 36 | case 'default': 37 | $("#api").text("IPIP.NET"); 38 | break; 39 | case 'ipip': 40 | $("#api").text("IPIP.NET"); 41 | break; 42 | case 'taobao': 43 | $("#api").text("淘宝"); 44 | break; 45 | case 'sina': 46 | $("#sina").text("新浪"); 47 | break; 48 | case 'geoip': 49 | $("#api").text("GeoIP"); 50 | break; 51 | } 52 | //获取数据 53 | if(type == 'all') { 54 | $.get("./AllInfo.php?ip="+ip,function(data,status){ 55 | var ipinfo = eval('(' + data + ')'); 56 | if(status == 'success') { 57 | $("#allip").text(ipinfo.ip); 58 | if(ipinfo.status == 1) { 59 | //$("#myip").hide(); 60 | //$("#ipinfo").hide(); 61 | $("#ipip").text(ipinfo.ipip); 62 | $("#taobao").text(ipinfo.taobao); 63 | $("#sina").text(ipinfo.sina); 64 | $("#geoip").text(ipinfo.geoip); 65 | $("#allinfo").show(); 66 | $("#loading").hide(); 67 | } 68 | else if(ipinfo.status == 0){ 69 | layer.open({ 70 | title: '错误提示' 71 | ,content: ipinfo.msg, 72 | }); 73 | $("#loading").hide(); 74 | } 75 | } 76 | }) 77 | } 78 | else{ 79 | $.get("./GetInfo.php?type="+type+"&ip="+ip,function(data,status){ 80 | if(status == 'success') { 81 | var ipinfo = eval('(' + data + ')'); 82 | //如果IP查询成功 83 | if(ipinfo.status == 1) { 84 | $("#reip").text(ipinfo.ip); 85 | $("#country").text(ipinfo.country); 86 | $("#region").text(ipinfo.region); 87 | $("#city").text(ipinfo.city); 88 | $("#isp").text(ipinfo.isp); 89 | $("#county").text(ipinfo.county); 90 | //$("#myip").hide(); 91 | //$("#allinfo").hide(); 92 | $("#ipinfo").show(); 93 | $("#loading").hide(); 94 | } 95 | //IP查询失败 96 | else if(ipinfo.status == 0) { 97 | layer.open({ 98 | title: '错误提示' 99 | ,content: ipinfo.msg, 100 | }); 101 | $("#loading").hide(); 102 | } 103 | } 104 | }); 105 | } 106 | }); 107 | }); 108 | function mobile(){ 109 | var protocol = window.location.protocol; 110 | var host = window.location.host; 111 | var pathname = window.location.pathname; 112 | var url = protocol + '//' + host + pathname; 113 | var qrcode = "https://pan.baidu.com/share/qrcode?w=200&h=200&url=" + url; 114 | var qrimg = "
    "; 115 | layer.open({ 116 | type: 1, 117 | title: '请用手机扫描访问' 118 | ,content: qrimg 119 | }); 120 | } 121 | function api(){ 122 | layer.open({ 123 | title: '温馨提示:' 124 | ,content: 'API正在开发中...敬请期待。' 125 | }); 126 | } 127 | function about(){ 128 | layer.open({ 129 | type: 2, 130 | title:'关于', 131 | area: ['800px', '600px'], 132 | content: './static/about.html' //这里content是一个URL,如果你不想让iframe出现滚动条,你还可以content: ['http://sentsin.com', 'no'] 133 | }); 134 | } 135 | //获取内网ip 136 | function getIPs(callback){ 137 | var ip_dups = {}; 138 | //compatibility for firefox and chrome 139 | var RTCPeerConnection = window.RTCPeerConnection 140 | || window.mozRTCPeerConnection 141 | || window.webkitRTCPeerConnection; 142 | var useWebKit = !!window.webkitRTCPeerConnection; 143 | //bypass naive webrtc blocking using an iframe 144 | if(!RTCPeerConnection){ 145 | //NOTE: you need to have an iframe in the page right above the script tag 146 | // 147 | // 148 | //