<%@ LANGUAGE = VBScript CodePage = 936%>
<!--#include file="mdbname.asp"-->
<%
'本程序作者:中国蓝狐[QQ54083049]
'官方网站:快网科技[www.kuaiwww.com]
'如果您商用,请联系购买正版,本程序受法律保护
'尊重劳动,享受服务,售后跟踪支持
%>
<%
Response.Buffer =True
Response.ExpiresAbsolute = Now() - 1
Response.Expires = 0
If err.number<>0 Then
Response.Write(err.description)
Response.End()
End If
On Error Resume Next
Dim strTemp,hk
If Trim(Request.QueryString) <> "" Then strTemp =Trim (Request.QueryString)
strTemp = LCase(strTemp)
hk=0
'以下是定义要过滤的字符,不够可以自己添加。
If Instr(strTemp,"%")<>0 then hk=1
If Instr(strTemp,"count(")<>0 then hk=1
If Instr(strTemp,"asc(")<>0 then hk=1
If Instr(strTemp,"mid(")<>0 then hk=1
If Instr(strTemp,"char(")<>0 then hk=1
If Instr(strTemp,"xp_cmdshell")<>0 then hk=1
If Instr(strTemp,"'")<>0 then hk=1
If Instr(strTemp,"union")<>0 then hk=1
If Instr(strTemp,"document.cookie")<>0 then hk=1
If Instr(strTemp,"document")<>0 then hk=1
If Instr(strTemp,"javascript")<>0 then hk=1
if hk=1 then
'当有以上任一特征码的时候就弹出提示阻止。
Response.Write "<script language='javascript'>"
Response.Write "alert('含有非法字符!!');"
Response.Write "history.back();"
Response.Write "</script>"
response.end
hk=0
End If
Dim Startime,Conn
Dim SqlString
Dim ConnStr
Startime = Timer()
'主数据
connstr = "Provider = Microsoft.Jet.OLEDB.4.0;Data Source = " & Server.MapPath(MyDbPath & Dbname)
On error Resume Next
Set conn = server.createObject("ADODB.Connection")
conn.open ConnStr
if err Then
err.clear
Set Conn = nothing
response.Write "数据库连接出错,请检查连接字串。"
response.end
end if
'//-------------------------------------------------------------
'IP地址
Set CiP=server.createobject("ADODB.CONNECTION")
costr="Provider = Microsoft.Jet.OLEDB.4.0;Data Source =" & Server.MapPath(MyDbPath & Las真美妙bName)
CiP.open costr
if err Then
err.clear
Set CiP = nothing
response.Write "数据库连接出错,请检查连接字串。"
response.end
end if
Sub CloseConn()
Conn.close
set Conn=nothing
Cip.close
set CiP=nothing
End Sub
%> |