Table of Contents
[PHP]代码   " >[PHP]代码   
Home php教程 PHP源码 php精简高速ip查询免费版3.0

php精简高速ip查询免费版3.0

May 25, 2016 pm 05:11 PM
php

php精简高速ip查询免费版3.0 

1.IP地址查询php版,采用淘宝IP地址库,非常的精准。并且会随着淘宝IP地址库实时更新。所以您获得的数据将会是最新的。 
2.此3.0核心函数代码加密 其它2.0 1.0 版本完全开源 
3.define('SINA_SAE', '0'); //是否启用新浪SAE平台1为使用0为不使用 如使用新浪SAE平台必须开启memcache 
4.define('REWRITE', '0'); //是否启用伪静态 
5.集成WhoIs信息查询接口 

.htaccess 通用伪静态规则 其它规则请参考下面的进行修改 
RewriteEngine on 
RewriteRule ^(.*)$ index.php?id=$1 [L] 

sina SAE专版伪静态规则 
- rewrite: if (!is_dir() && !is_file() && path ~ "/(.*)" ) goto "index.php?$1" 

文件说明 
index.php      主程序 
function.php   主函数 

其它文件 
readme.txt     说明文件 
cacheip.txt    数据缓存文件 
bg_body.jpg    背景图 

[PHP]代码   

<?php ob_start(&#39;ob_gzip&#39;);   //gzip压缩
define(&#39;SINA_SAE&#39;, &#39;0&#39;); //是否启用新浪SAE平台1为使用0为不使用
define(&#39;REWRITE&#39;, &#39;0&#39;); //是否启用伪静态 1为启用0为不启用
$weburl=getenv(&#39;SERVER_NAME&#39;);
require_once(&#39;function.php&#39;);
$weblink=REWRITE?"http://".$weburl."/":"http://".$weburl."/?";if(count($_GET)>0){$urlip=array_keys($_GET);$urlip=str_replace("/","",str_replace("_",".",$urlip[0]));}
$ipname=$ip=$_POST[&#39;ip&#39;]?$_POST[&#39;ip&#39;]:$urlip;?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<TITLE><?php if($ip){echo $urlip.",";}?>IP地址查询,淘宝ip,新浪ip,电脑IP地址查询,网站IP地址查询,精确IP地址查询-<?=$weburl;?></TITLE>
<META NAME="Generator" CONTENT="ip,代理IP查询,IP地址查询">
<META NAME="Author" CONTENT="IP查询,tbip.sinaapp.com">
<META NAME="Keywords" CONTENT="电脑IP地址查询,淘宝ip,新浪ip,网站IP地址查询,IP地址查询,代理IP查询,域名ip地址,域名whois,<?=$weburl;?>">
<META NAME="Description" CONTENT="电脑IP地址查询主要能够查询本地电脑的ip,网站IP地址,域名ip地址,ip所在省区,域名whois信息,代理IP查询并提供IP地址查询php源码下载尽在<?=$weburl;?>">
<style type="text/css">body {font-size:14px;line-height:150%;background-image: url(<?=$weblink?>bg_body.jpg);background-repeat:repeat-x;}
a{ text-decoration:none; color:#990000}.detect_table {border: 1px solid #C3E1EE;border-collapse: collapse;margin-top: 5px;width: 650px;}</style>
<SCRIPT LANGUAGE="JavaScript">function checkIP(){var ipArray,ip,j;ip = document.ipform.ip.value;if(/[A-Za-z_-]/.test(ip)){if(!/^([\w-]+\.)+((com)|(net)|(org)|(gov\.cn)|(info)|(cc)|(com\.cn)|(com\.hk)|(net\.cn)|(org\.cn)|(com\.ru)|(net\.ru)|(org\.ru)|(name)|(biz)|(hk)|(vn)|(com\.sg)|(pk)|(ph)|(ac)|(bz)|(de)|(net\.au)|(my)|(tv)|(us)|(jp)|(kr)|(sg)|(mn)|(cd)|(ue)|(sh)|(lc)|(hn)|(me)|(la)|(cc)|(tk)|(com\.tw)|(cm)|(cn))$/.test(ip)){alert("不是正确的域名,请检查域名格式或看是否有空格");	document.ipform.ip.focus();return false;}}else{ipArray = ip.split(".");j = ipArray.length;if(j!=4){alert("不是正确的IP");document.ipform.ip.focus();return false;}for(var i=0;i<4;i++){if(ipArray[i].length==0 || ipArray[i]>255){alert("不是正确的IP");document.ipform.ip.focus();return false;}}}}google_ad_client = "ca-pub-2006512290696014";google_ad_slot = "6662313368";google_ad_width = 468;google_ad_height = 60;
</script></head><body>
<?php
if(!$ip)$ip=get_real_ip();
$ip=preg_match(&#39;/((\w|-)+\.)+[a-z]{2,4}/i&#39;,$ip)?gethostbyname($ip):$ip;$ipdata=ipdata($ip,&#39;all&#39;);?>
<p align="center" style="margin-top:100px">
<p> </p><p><a href="http://ref.so/pv18" title="<?=$weburl;?>IP查询介绍" target="_blank">IP查询</a></p>
</p>
<p class="c" align="center">
<p>
<FORM METHOD=POST ACTION="" name="ipform" onsubmit="return checkIP();">
<p>IP地址或域名:
<input type="text" name="ip" size="27" maxlength="100" title="<?=$weburl;?>提醒您在此输入ip或域名" id="url" value="<?=$ipname?>"> 
<input type="submit" value="查 询" id="sub"><INPUT TYPE="hidden" name="action" value="2"></p>
</FORM>
<p><?php
if(is_ip($ip)){
	$ipaddress=$ipdata->country;
	if($ipdata->region==$ipdata->city){$ipaddress.=$ipdata->city;}else{$ipaddress.=$ipdata->region.$ipdata->city;}
	$ipaddress.=$ipdata->isp;
	echo "您查询的IP: [<a href=&#39;".$weblink.$ip."&#39;><font color=#FF0000>".$ip."</font></a>]IP详细地址: [<font color=#FF0000>".$ipaddress."</font>]<br/>"; 
}else{echo "囧,你输入的IP,居然不能查询到!不是输入错误?";}
$ipdaili=$_SERVER[&#39;REMOTE_ADDR&#39;];
if(!in_array($ipdaili,array(&#39;127.0.0.1&#39;,$ip,$_SERVER[&#39;SERVER_ADDR&#39;],get_real_ip()))){
	echo "您的代理IP是[<a href=&#39;".$weblink.$ipdaili."&#39;><font color=#FF0000>".$ipdaili."</font></a>]     来自".ipdata($ipdaili)."";
}
$whiosip=$_POST[&#39;ip&#39;]?$_POST[&#39;ip&#39;]:$urlip;
if($whiosip){preg_match(&#39;/((\w|-)+\.)+[a-z]{2,4}/i&#39;,$whiosip) ? $whois=str_replace("www.","",$whiosip):"";}
if($whois){echo "<br /><br /><a href=&#39;http://2.tbip.sinaapp.com/whois.php?d=".$whois."&#39; target=&#39;_blank&#39; title=&#39;数据来源于本站WhoIs信息查询接口&#39;>".$whois." WhoIs信息</a> <a href=&#39;http://www.ddung.org/tool/icp/index.php?k=".$whois."&#39; target=&#39;_blank&#39; title=&#39;数据来源于迷糊工具网 www.ddung.org备案信息查询接口&#39;>".$whois." 备案信息</a> <a href=&#39;http://72e.hbwanghai.com/domain/who_single.aspx?DomainName=".$whois."&#39; title=&#39;数据来源于联动天下72e.hbwanghai.com WhoIs信息查询接口&#39; target=&#39;_blank&#39;>".$whois." WhoIs信息</a>";}$sinaip=sinaip($ip);if($whois){cacheip($whiosip);}else{cacheip($ip);}
?></p></p></p>
<p align="center" style="margin-top:50px">
<table class="detect_table" id="ip_all">
<tbody><tr><th>IP</th><th>国家/地区</th><th>省份</th><th>城市</th><th>运营商</th><th>来源</th></tr>
<tr><td align="center"><span class="sip"><?=$ip;?></span></td><td align="center"><?=$ipdata->country.$ipdata->area?></td><td align="center"><?=$ipdata->region?></td><td align="center"><?=$ipdata->city?></td><td align="center"><?=$ipdata->isp?></td><td align="center">淘宝</td></tr>
<tr><td align="center"><span class="sip"><?=$ip;?></span></td><td align="center"><?=$sinaip[3]?></td><td align="center"><?=$sinaip[4]?></td><td align="center"><?=$sinaip[5]?></td><td align="center"><?=$sinaip[9]?><?=$sinaip[7]?></td><td align="center">新浪</td></tr>
  <tr><td align="center"><span class="sip">其它结果</span></td><td align="center"><a href="http://2.tbip.sinaapp.com/?ip=<?=$ip?>&type=qq" target="_blank">腾讯搜索结果</a></td><td align="center"><a href="http://2.tbip.sinaapp.com/?ip=<?=$ip?>&type=chunzhen" target="_blank">纯真搜索结果</a></td><td align="center"><a href="http://2.tbip.sinaapp.com/?ip=<?=$ip?>&type=pconline" target="_blank">太平洋搜索结果</a></td><td align="center"><a href="http://2.tbip.sinaapp.com/?ip=<?=$ip?>&type=google" target="_blank">谷歌搜索结果</a></td><td align="center"><a href="http://2.tbip.sinaapp.com/?ip=<?=$ip?>&type=youdao" target="_blank">有道搜索结果</a></td></tr>
</tbody></table><br><table class="detect_table" id="ip_all">
<tbody><tr>
<?php foreach(cacheip() as $k => $v){
if($k==6)echo "</tr><tr>";
echo &#39;<td align="center"><a href="&#39;.$weblink.$v.&#39;">&#39;.$v.&#39;</a></td>&#39;;}?></tr>
</tbody></table><br>
<?=base64_decode("PHNjcmlwdCB0eXBlPSJ0ZXh0L2phdmFzY3JpcHQiIHNyYz0iaHR0cDovL3BhZ2VhZDIuZ29vZ2xlc3luZGljYXRpb24uY29tL3BhZ2VhZC9zaG93X2Fkcy5qcyI+PC9zY3JpcHQ+");?>
  <p>Copyright &copy; <a href="http://72e.hbwanghai.com" target="_blank">联动天下</a> <a href="http://www.ddung.org/tool/icp/" target="_blank">域名备案查询</a> <a href="http://taokehui.sinaapp.com" target="_blank">健康减肥</a> All Rights Reserved <a href="<?=$weblink;?>"><?=$weburl;?></a> <a href="http://www.ctdisk.com/u/349707/437278" target="_blank">源码下载</a></p><p>本站为非赢利站点,如有好的建议和意见请发email:web@hbwanghai.com.给我们留言谢谢!
<br>
如果您觉得本站对您的朋友有帮助,别忘了告诉他(她)们哟 ^_^<br>点击广告赞助本站开发!</p><p class="bdlikebutton"></p>
<script id="bdlike_shell"></script>
<script>var bdShare_config = {"type":"large","color":"blue","uid":"533431","share":"yes"};
document.getElementById("bdlike_shell").src="http://bdimg.share.baidu.com/static/js/like_shell.js?t=" + new Date().getHours();
</script></p><p style="display:none"><script language="javascript" type="text/javascript" src="http://js.users.51.la/3729735.js"></script></p></body>
</html><?php ob_end_flush(); ?>
Copy after login

  

 QQ截图20120602103554.png                     

php精简高速ip查询免费版3.0

                                           

Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

Notepad++7.3.1

Notepad++7.3.1

Easy-to-use and free code editor

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

Zend Studio 13.0.1

Zend Studio 13.0.1

Powerful PHP integrated development environment

Dreamweaver CS6

Dreamweaver CS6

Visual web development tools

SublimeText3 Mac version

SublimeText3 Mac version

God-level code editing software (SublimeText3)

PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian PHP 8.4 Installation and Upgrade guide for Ubuntu and Debian Dec 24, 2024 pm 04:42 PM

PHP 8.4 brings several new features, security improvements, and performance improvements with healthy amounts of feature deprecations and removals. This guide explains how to install PHP 8.4 or upgrade to PHP 8.4 on Ubuntu, Debian, or their derivati

How To Set Up Visual Studio Code (VS Code) for PHP Development How To Set Up Visual Studio Code (VS Code) for PHP Development Dec 20, 2024 am 11:31 AM

Visual Studio Code, also known as VS Code, is a free source code editor — or integrated development environment (IDE) — available for all major operating systems. With a large collection of extensions for many programming languages, VS Code can be c

7 PHP Functions I Regret I Didn't Know Before 7 PHP Functions I Regret I Didn't Know Before Nov 13, 2024 am 09:42 AM

If you are an experienced PHP developer, you might have the feeling that you’ve been there and done that already.You have developed a significant number of applications, debugged millions of lines of code, and tweaked a bunch of scripts to achieve op

How do you parse and process HTML/XML in PHP? How do you parse and process HTML/XML in PHP? Feb 07, 2025 am 11:57 AM

This tutorial demonstrates how to efficiently process XML documents using PHP. XML (eXtensible Markup Language) is a versatile text-based markup language designed for both human readability and machine parsing. It's commonly used for data storage an

Explain JSON Web Tokens (JWT) and their use case in PHP APIs. Explain JSON Web Tokens (JWT) and their use case in PHP APIs. Apr 05, 2025 am 12:04 AM

JWT is an open standard based on JSON, used to securely transmit information between parties, mainly for identity authentication and information exchange. 1. JWT consists of three parts: Header, Payload and Signature. 2. The working principle of JWT includes three steps: generating JWT, verifying JWT and parsing Payload. 3. When using JWT for authentication in PHP, JWT can be generated and verified, and user role and permission information can be included in advanced usage. 4. Common errors include signature verification failure, token expiration, and payload oversized. Debugging skills include using debugging tools and logging. 5. Performance optimization and best practices include using appropriate signature algorithms, setting validity periods reasonably,

PHP Program to Count Vowels in a String PHP Program to Count Vowels in a String Feb 07, 2025 pm 12:12 PM

A string is a sequence of characters, including letters, numbers, and symbols. This tutorial will learn how to calculate the number of vowels in a given string in PHP using different methods. The vowels in English are a, e, i, o, u, and they can be uppercase or lowercase. What is a vowel? Vowels are alphabetic characters that represent a specific pronunciation. There are five vowels in English, including uppercase and lowercase: a, e, i, o, u Example 1 Input: String = "Tutorialspoint" Output: 6 explain The vowels in the string "Tutorialspoint" are u, o, i, a, o, i. There are 6 yuan in total

Explain late static binding in PHP (static::). Explain late static binding in PHP (static::). Apr 03, 2025 am 12:04 AM

Static binding (static::) implements late static binding (LSB) in PHP, allowing calling classes to be referenced in static contexts rather than defining classes. 1) The parsing process is performed at runtime, 2) Look up the call class in the inheritance relationship, 3) It may bring performance overhead.

What are PHP magic methods (__construct, __destruct, __call, __get, __set, etc.) and provide use cases? What are PHP magic methods (__construct, __destruct, __call, __get, __set, etc.) and provide use cases? Apr 03, 2025 am 12:03 AM

What are the magic methods of PHP? PHP's magic methods include: 1.\_\_construct, used to initialize objects; 2.\_\_destruct, used to clean up resources; 3.\_\_call, handle non-existent method calls; 4.\_\_get, implement dynamic attribute access; 5.\_\_set, implement dynamic attribute settings. These methods are automatically called in certain situations, improving code flexibility and efficiency.

See all articles