📄 index.asp
字号:
<!--#include file="conn.asp" -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>数字锦州-IP地址与手机号码地址查询v2.0</title>
<link rel="stylesheet" href="css/style.css" type="text/css">
</head>
<body>
<div align="center">
<center>
<table width="100%">
<td valign=top >
<div align="center">
<table border="0" width="98%" id="table5">
<tr>
<td background="images/cpb_line1.gif" height="5"></td>
</tr>
<tr>
<td>
<!--news-->
<table border="0" width="100%" id="table4" cellPadding=4 cellSpacing=1 align=center>
<tr>
<td>
<% '统计
dim sql, rs,countip,countip1,countsj,countsj1
set rs=conn.execute("select * from home")
countip=rs("iptg")
countip1=rs("ipmtg")
countsj=rs("sjtg")
countsj1=rs("sjmtg")
grade=rs("grade")
lock=rs("lock")
set rs=nothing
%>
<table border="1" width="100%" id="table4" cellPadding=4 cellSpacing=0 class=cpb_tr_bgcolor2 align=center bordercolorlight="#808080" bordercolordark="#C0C0C0">
<tr>
<td width="100%" align="center" height="22" class=cpb_tr_bgcolor1 bgcolor="#C0C0C0">
<font color="#000000">
IP地址与手机号码地址查询</font></td></tr>
</table>
<BR>
<%
myip = Request.ServerVariables("HTTP_X_FORWARDED_FOR")
if myip = "" or myip="unknown" then myip = Request.ServerVariables("REMOTE_ADDR")
if chktopic(request("search"))<>"" then
fip=chktopic(request("ip"))
c=fip
'--------拆分ip,目的是为了给前面为0的数据去掉,同时也判断ip地址是否合法--------
fip = Split(fip,".")
if Ubound(fip)=3 then
For i=0 To Ubound(fip)
fip(i)=left(fip(i),3)
if isnumeric(fip(i)) then
fip(i)=cint(fip(i))
else
fip(i)=0
end if
next
oip=fip(0)*256*256*256+fip(1)*256*256+fip(2)*256+fip(3)
'--------重新组合ip后,与数据库的ip地址比较,获取地址,采用三种不同方法的目的是为了当前两个ip段相同时,得到的地址比较具体--------
sql1="select top 1 * from wry where startip<="&oip&" and endip>="&oip&" and grade=1 "
set rs1=conn.execute(sql1)
if not rs1.eof then
a=rs1("country")
b=rs1("local")
n=rs1("thank")
else
a="找不到地址,如果您知道,请与本站联系,谢谢!"
end if
rs1.close()
set rs1=nothing
else
a="错误:您输入的ip地址非法,请重新输入!"
end if
%>
<div align="center">
<table border="1" width="100%" id="table4" cellPadding=4 cellSpacing=0 class=cpb_tr_bgcolor2 align=center bordercolorlight="#808080" bordercolordark="#C0C0C0">
<tr>
<td colspan="2" align="center" height="22" class=cpb_tr_bgcolor1><font color="#000000">搜索结果:</font></td>
</tr>
<tr class=cpb_td_bgcolor1>
<td width="28%" align="center" height="22" >你要搜索的IP:</td>
<td width="75%" align="center" height="22" ><%=c%></td>
</tr>
<tr class=cpb_td_bgcolor1>
<td width="28%" align="center" height=22 >所在地址:</td>
<td width="75%" align="center" height=22 ><%=a%> <%=b%> <%=n%></td>
</tr>
</table>
</div>
<p>
<%end if
'注册ip地址
if chktopic(request.form("regip"))="ip" then
if lock<>"0" then
response.write("<script>alert('暂时不允许添加数据');history.back();</script>")
response.end
end if
fip=trim(chktopic(request.form("startip")))
'--------拆分ip
fip = Split(fip,".")
if Ubound(fip)=3 then
For i=0 To Ubound(fip)
fip(i)=left(fip(i),3)
if isnumeric(fip(i)) then
fip(i)=cint(fip(i))
else
fip(i)=0
end if
next
startip=fip(0)*256*256*256+fip(1)*256*256+fip(2)*256+fip(3)
else
errnum=1
errmsg="开始ip非法\n"
end if
fip=trim(chktopic(request.form("endip")))
'--------拆分ip
fip = Split(fip,".")
if Ubound(fip)=3 then
For i=0 To Ubound(fip)
fip(i)=left(fip(i),3)
if isnumeric(fip(i)) then
fip(i)=cint(fip(i))
else
fip(i)=0
end if
next
endip=fip(0)*256*256*256+fip(1)*256*256+fip(2)*256+fip(3)
else
errnum=1
errmsg=errmsg&"结束ip非法\n"
end if
country=chktopic(request.form("country"))
address=chktopic(request.form("address"))
name=chktopic(request.form("name"))
if name<>"" then name=name&"提供"
if address="" or country="" or len(address)>80 or len(country)>14 or len(name)>20 then
errnum=1
errmsg=errmsg&"国家/省份不能为空或者超过14个字节\n详细地址不能为空或者超过80个字节\n您的姓名不能超过18个字节\n"
end if
if errnum=1 then
response.write("<script>alert('"&errmsg&"');history.back();</script>")
else
sql1="select grade from wry where startip="&startip&" and endip="&endip&""
set rs1=conn.execute(sql1)
if not rs1.eof then
response.write("<script>alert('很抱歉!您提交的数据已经存在,请重新输入');history.back();</script>")
response.end
end if
gtitle="您所提交的ip已经加入库中"
sql="insert into wry (startip,endip,country,local,thank,grade) values ("&startip&","&endip&",'"&country&"','"&address&"','"&name&"',"&grade&")"
conn.execute(sql)
sql="update home set iptg=iptg+1"
if grade="0" then
sql=sql&",ipmtg=ipmtg+1"
end if
conn.execute(sql)
errmsg="谢谢您的数据!">itle
response.write("<script>alert('"&errmsg&"');history.back();</script>")
response.end
end if
'注册手机
elseif chktopic(request.form("regip"))="sj" then
if lock<>"0" then
response.write("<script>alert('暂时不允许添加数据');history.back();</script>")
response.end
end if
d=chktopic(request.form("startip"))
if len(d)>=7 and IsNumeric(d) then
startip=left(d,7)
else
errnum=1
errmsg=errmsg&"开始手机号码非法,必须为大于7位的数字\n"
end if
d=chktopic(request.form("endip"))
if len(d)>=7 and IsNumeric(d) then
endip=left(d,7)
else
errnum=1
errmsg=errmsg&"结束手机号码非法,必须为大于7位的数字\n"
end if
country=chktopic(request.form("country"))
address=chktopic(request.form("address"))
name=chktopic(request.form("name"))
quhao=chktopic(request.form("quhao"))
if name<>"" then name=name&"提供"
if address="" or country="" or quhao="" or len(address)>20 or len(country)>20 or len(name)>20 or len(quhao)>20 then
errnum=1
errmsg=errmsg&"国家/省份不能为空或者超过20个字节\n详细地址不能为空或者超过20个字节\n区号与描述不能为空或者超过20个字节\n您的姓名不能超过18个字节\n"
end if
if errnum=1 then
response.write("<script>alert('"&errmsg&"');history.back();</script>")
response.end
else
sql1="select grade from mod where start="&startip&" and end="&endip&""
set rs1=conn.execute(sql1)
if not rs1.eof then
response.write("<script>alert('很抱歉!您提交的数据已经存在,请重新输入');history.back();</script>")
response.end
end if
gtitle="您所提交的手机号码已经加入库中"
sql="update home set sjtg=sjtg+1"
if grade=0 then
sql=sql&",sjmtg=sjmtg+1"
end if
conn.execute(sql)
sql="insert into mod (start,end,city,city1,thank,grade,url) values ("&startip&","&endip&",'"&country&"','"&address&"','"&name&"',"&grade&",'"&quhao&"')"
conn.execute(sql)
errmsg="谢谢您的数据!">itle
response.write("<script>alert('"&errmsg&"');history.back();</script>")
response.end
end if
end if
'手机查询
if chktopic(request.form("searchsj"))<>"" then
d= chktopic(request.form("num1"))
'判断是否为数字或者大于7位的数字
if len(d)>=7 and IsNumeric(d) then
c=left(d,7)
sql="select * from mod where right(start,1)<="&right(c,1)&" and right(end,1)>="&right(c,1)&" and left(start,6)="&left(c,6)&" and left(end,6)="&left(c,6)&" and grade=1"
set rs=conn.execute(sql)
if not rs.eof then
a=rs("city")
b=rs("city1")
e=rs("url")
f=rs("thank")
set rs=nothing
else
sql="select * from mod where right(start,2)<="&right(c,2)&" and right(end,2)>="&right(c,2)&" and left(start,5)="&left(c,5)&" and left(end,5)="&left(c,5)&" and grade=1 "
set rs=conn.execute(sql)
if not rs.eof then
a=rs("city")
b=rs("city1")
e=rs("url")
f=rs("thank")
set rs=nothing
else
sql="select * from mod where right(start,3)<="&right(c,3)&" and right(end,3)>="&right(c,3)&" and left(start,4)="&left(c,4)&" and left(end,4)="&left(c,4)&" and grade=1 "
set rs=conn.execute(sql)
if not rs.eof then
a=rs("city")
b=rs("city1")
e=rs("url")
f=rs("thank")
set rs=nothing
else
sql="select * from mod where start<="&c&" and end>="&c&" and grade=1"
set rs=conn.execute(sql)
if not rs.eof then
a=rs("city")
b=rs("city1")
e=rs("url")
f=rs("thank")
set rs=nothing
else
a="找不到地址,如果你知道,请与本站联系,谢谢!"
end if
end if
end if
end if
else
a="错误:请确保你输入的是大于7位的数字!"
end if
%>
<div align="center">
<table border="1" width="100%" id="table4" cellPadding=4 cellSpacing=0 class=cpb_tr_bgcolor2 align=center bordercolorlight="#808080" bordercolordark="#C0C0C0">
<tr >
<td width="100%" colspan="2" align="center" height="22" class=cpb_tr_bgcolor1><font color="#000000">搜索结果:</font></td>
</tr>
<tr class=cpb_td_bgcolor1>
<td width="28%" align="center" height="22" >你要搜索的手机号码:</td>
<td width="75%" align="center" height="22" ><%=d%></td>
</tr>
<tr class=cpb_td_bgcolor1>
<td width="28%" align="center" height=22 >所在地址:</td>
<td width="75%" align="center" height=22 ><%=a%> <%=b%> </td>
</tr>
<tr class=cpb_td_bgcolor1>
<td width="28%" align="center" height=22 >区号和描述:</td>
<td width="75%" align="center" height=22 ><%=e%> <%=f%></td>
</tr>
</table>
</div>
<p>
<%end if
'--------拆分ip,目的是为了给不足3位的补0,同时也判断ip地址是否合法--------
myip1 = Split(myip,".")
if Ubound(myip1)=3 then
For i=0 To Ubound(myip1)
myip1(i)=left(myip1(i),3)
if isnumeric(myip1(i)) then
myip1(i)=cint(myip1(i))
else
myip1(i)=0
end if
next
myip2=myip1(0)*256*256*256+myip1(1)*256*256+myip1(2)*256+myip1(3)
sql="select * from wry where startip<="&myip2&" and endip>="&myip2&"and grade=1"
set rs=conn.execute(sql)
if not rs.eof then
a1=rs("country")
b1=rs("local")
n1=rs("thank")
else
a="找不到地址,如果你知道,请与本站联系,谢谢!"
end if
rs.close()
set rs=nothing
else
a1="抱歉,找不到地址!"
end if
%>
<div align="center">
<table border="1" width="100%" id="table4" cellPadding=4 cellSpacing=0 class=cpb_tr_bgcolor2 align=center bordercolorlight="#808080" bordercolordark="#C0C0C0">
<tr >
<td width="100%" align="center" height="22" class=cpb_tr_bgcolor1 colspan="2">
<font color="#000000">
搜索某一 IP 地址的地理位置</font></td>
</tr>
<tr class=cpb_td_bgcolor1 >
<td width="28%" align="center" height=22 >
请输入要搜索的IP地址:
</td>
<form method="post" action="index.asp">
<td width="75%" align="center" height=22 >
<input type="text" name="ip" size="20" >
<input type="hidden" name="search" size="20" value=search>
<input type="submit" value="查 询" name="B1" class=cpb_button_color>
</td> </form>
</tr>
<tr class=cpb_td_bgcolor1>
<td width="28%" align="center" height=22 >
你当前所在的IP:
</td>
<td width="75%" align="center" height=22 >
<%=myip%> 来自:<%=a1%> <%=b1%> <%=n1%>
</td>
</tr>
</table>
</div>
<div align="center">
<table border="1" width="100%" cellPadding=4 cellSpacing=0 class=cpb_tr_bgcolor2 align=center bordercolorlight="#808080" bordercolordark="#C0C0C0">
<tr>
<td width="100%" align="center" height="22" class=cpb_tr_bgcolor1 colspan="2">
<font color="#000000">
搜索手机号码对应的地理位置</font></td>
</tr>
<tr class=cpb_td_bgcolor2 >
<td width="28%" align="center" height=22 bgcolor="#FFFFFF" >
请输入要搜索的号码:
</td>
<form method="post" action="index.asp">
<td width="75%" align="center" height=22 bgcolor="#FFFFFF" >
<input type="text" name="num1" size="20" >
<input type="hidden" name="searchsj" size="20" value=search>
<input type="submit" value="查 询" name="B1" class=cpb_button_color>
</td> </form>
</tr>
</table>
</td>
</tr>
</table>
<%call closedb()%>
</table>
</center>
</div>
</table>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -