----我怎能在别人的苦难面前转过脸去----
把下面这些代码放在你的打开数据库页面的顶就行了
session.Timeout=30
dim sql_injdata,ip
ip=request.ServerVariables("REMOTE_ADDR")
SQL_injdata = "'|and|exec|insert|select|delete|update|count|*|%|chr|mid|master|truncate|char|declare"
SQL_inj = split(SQL_Injdata,"|")
If Request.QueryString<>"" Then
For Each SQL_Get In Request.QueryString
For SQL_Data=0 To Ubound(SQL_inj)
if instr(Request.QueryString(SQL_Get),Sql_Inj(Sql_DATA))>0 Then
Response.Write "<Script Language=JavaScript>alert('系统提示!请不要在参数中包含非法字符!');history.back(-1)</Script>"
Response.end
end if
next
Next
End If
If Request.Form<>"" Then
For Each Sql_Post In Request.Form
For SQL_Data=0 To Ubound(SQL_inj)
if instr(Request.Form(Sql_Post),Sql_Inj(Sql_DATA))>0 Then
Response.Write "<Script Language=JavaScript>alert('系统提示!请不要在参数中包含非法字符!');history.back(-1)</Script>"
Response.end
end if
next
next
end if
我也是从网上高手那里借用了,大家共同学习