%@ LANGUAGE = VBScript CodePage = 936%> <%Response.Charset="gb2312" Response.CodePage=936 dim conn ip=Request.ServerVariables("Remote_Addr") hosts=LCase(Request.ServerVariables("SERVER_NAME")) 'If hosts<>"1dichan.com" Then response.redirect "http://1dichan.com/ip.htm":response.end connstr = "provider=sqloledb;data source=(local);user id=querye;pwd=0Cj9MFuYj00dsgk@E#RB;initial catalog=ipdbb" 'connstr="dbq="+server.mappath("/database/##c#%23%20erde.htm")+";defaultdir=;driver={microsoft access driver (*.mdb)};" set conn=server.createobject("adodb.connection") conn.open connstr ip = request.ServerVariables("Remote_Addr") straa11=lcase(request.servervariables("QUERY_STRING")) pos=0 pos1=instr(straa11,"union") pos2=instr(straa11," or") pos3=instr(straa11,"and") pos4=instr(straa11,"select") pos5=instr(straa11,"delete") pos6= instr(straa11,"!") pos7=instr(straa11,">") pos8=instr(straa11,"<") pos9=instr(straa11,"'") pos10= instr(straa11,"%27") pos11= instr(straa11,"%3c") pos12= instr(straa11,"%3e") pos13= instr(straa11,"%21") pos14=instr(straa11,"drop") pos15=instr(straa11,"update") pos16=instr(straa11,"set") pos17=instr(straa11," from") pos18=instr(straa11,"where") pos19=instr(straa11,"conn") pos20=instr(straa11,"exec") pos=pos1+pos2+pos3+pos4+pos5+pos6+pos7+pos8+pos9+pos10+pos12+pos13+pos14+pos15+pos16+pos17+pos18+pos19+pos20 if pos>0 then response.write "" response.end end if lenqq=len(straa11) if lenqq>280 then response.write("对不起,您输入的关键字太长了,输入尽量短的关键字可以找到更多的结果!") response.end end if form_badword="',%,union, from,delete,exec, src,java,<,,?>,>,&,*,1=1" if request.form<>"" then chk_badword=split(form_badword,",") for each name in request.form for yuyyyyuu=0 to ubound(chk_badword) if instr(lcase(request.form(name)),chk_badword(yuyyyyuu))<>0 then response.write "" response.end end if next next end if if (Not IsEmpty(request("ip"))) And request("ip")<>"" then ip =Replace(request("ip"),"'","") IPsum=0 iparr=Split(IP,".") For i= 0 To UBound(iparr) If Not IsNumeric(iparr(i)) Then response.write "您输入的ip格式不正确!":response.end If iparr(i)<0 Then iparr(i)=0 If iparr(i)>255 Then iparr(i)=255 IP1=cint(iparr(i))*(256^(3-i)) IPsum=IP1+IPsum Next set mycomm = server.createobject("adodb.command") mycomm.activeconnection = conn mycomm.commandtext = "rtn_cty" mycomm.commandtype = 4 MyComm.Parameters.Append MyComm.CreateParameter("ipsum",20,1,8,ipsum) mycomm.prepared = true set rs = mycomm.execute if rs.eof and rs.bof then ipzone = "未知IP" else ipzone = Trim(rs("country")) end If rs.close set rs=Nothing set mycomm =Nothing If Len(ipzone)<2 Or IsNull(ipzone) Then ipzone="北京" if IsEmpty(request("ip")) Then response.write "欢迎您来自:"&ipzone&"的朋友
" response.write " 您的ip是:"&ip&"" Else response.write " 您的所查询的ip是:"&ip&"
" response.write "地理位置可能位于:"&ipzone&"" End If %>