<?php
		// --------------------------------------------------------------------------
		//
		// File name   : index.php
		// Description : 网站主程序
		// Requirement : - PHP5 (http://www.php.net)
		//
		// Copyright(C), 24dian.com, 2002-2010, All Rights Reserved.
		//
		// Author: 24点 (24dian@24dian.com) 
		//
		// --------------------------------------------------------------------------
		
		require("lib/class.function.lib.php");
?>
<!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=gb2312" />
<title>24点网IP地址所属地查询</title>
</head>

<body>
<h1 align="center"><strong><br />
24点网IP地址所属地查询</strong></h1>
<br />
<center>
<?php
		$onlineip = get_ip();
?>
 您的IP地址是：["<?=$onlineip?>"]，此IP所属地："<?=convert_ip($onlineip)?>"<br />


</center>
<br />
<table cellspacing="0" bordercolordark="#ffffff" cellpadding="3" width="600" align="center" bordercolorlight="#008000" border="1">
  <form action=""   method="post" name="ipform" id="ipform" onsubmit="return checkIP()">
    <tr>
      <td onmouseover="this.style.backgroundColor='#E6F2E7'" onmouseout="this.style.backgroundColor=''" bgcolor="#cce6cd"><div  style="text-align:center;font-size:14px; font-weight:bold; line-height:25px">输入IP即可知道此IP所属的位置:</div></td>
    </tr>
    <tr>
      <td style="padding:15px"><div  style="text-align:center;">
        <input  name="ip_num" id="ip_num" value="<?=$pre_ip?>" size="30" />
        &nbsp;
        <input type="submit" value="提 交"  name="Submit" />
        <input id="act" type="hidden" value="1"  name="act" />
      </div>
      </td>
    </tr>
  </form>
</table>
<div   style="text-align:center;font-size:14px; font-weight:bold; line-height:25px">
  <?php
			if(isset($act)&&!empty($ip_num))
			{
					$pre_ip =  $ip_num;
					
					$ip_area = convert_ip($ip_num);
					
					$ip_search_show = "<table><TR onMouseOver=\"this.style.backgroundColor='#E6F2E7'\" onmouseout=\"this.style.backgroundColor=''\" bgColor=\"#ffffff\">
											 <TD width=\"40%\"><div style=\"text-align:center\">您要查询的IP地址是：</div></TD>
											 <TD><div style=\"text-align:center\">".$pre_ip."</div></TD>
									   </TR>
									   <TR onMouseOver=\"this.style.backgroundColor='#E6F2E7'\" onmouseout=\"this.style.backgroundColor=''\" bgColor=\"#ffffff\">
											 <TD width=\"40%\"><div style=\"text-align:center\">IP所属地：</div></TD>
											 <TD><div style=\"text-align:center\">".$ip_area."</div></TD>
										</TR></table> ";
			}
			else   
			{
					$ip_search_show = "";
			}
			
			echo $ip_search_show;
	?>
</div>
<p align="center"><small>如发现小部分IP查询结果不正确请到官方网站<a href="http://www.apnic.net" target="_blank">http://www.apnic.net</a>查询,以apnic为准。</small></p>

<p align="center">Copyright&copy;2002-2010 <a href="http://www.24dian.com" target="_blank">24dian.com</a>, All Rights   Reserved</p>
</body>
</html>
