<%
Dim Query_badword,form_badword,i,err_message,err_web,name
Err_message = 1 ' processing mode: 1 = hint information, 2 = Turn page, 3 = prompt before turning
Err_web = "err.asp" The page to turn when error
Query_badword= "' ∥AND∥SELECT∥UPDATE∥CHR∥DELETE∥%20FROM∥;∥INSERT∥MID∥MASTER.∥SET∥CHR (37) ∥="
' Define get illegal parameters in this section, use ' ∥ ' interval
Form_badword= "' ∥%∥&∥*∥#∥ (∥) ∥=" ' defines post illegal parameters in this section, using the "∥" interval
'
On Error Resume Next
'-----Filter the Get query value.
If request. Querystring<> "" Then
Chk_badword=split (Query_badword, "∥")
For each query_name in Request.QueryString
For i=0 to UBound (Chk_badword)
If Instr (LCase, request. QueryString (Query_name)), Chk_badword (i)) <>0 Then
Select Case Err_message
Case "1"
Response.Write "<script Language=javascript>alert" (' Pass parameter Error! The value of the parameter ' &name& ' contains an illegal string! nn please do not appear in the parameter: and update delete; Insert the illegal characters such as Mid master! '); Window.close ();</script> "
Case "2"
Response.Write "<script language=javascript>location.href= '" &Err_Web& "' </Script>"
Case "3"
Response.Write "<script Language=javascript>alert" (' Pass parameter Error! The value of the parameter ' &name& ' contains an illegal string! nn please do not appear in the parameter: and update delete; Insert the illegal characters such as Mid master! Location.href= ' "&Err_Web&" ';</script> "
End Select
Response.End
End If
NEXT
NEXT
End If
'-----Filter the Post form values.
If request.form<> "then
Chk_badword=split (Form_badword," ∥ ")
for each name in Request.Form
for i=0 t O UBound (chk_badword)
If Instr (LCase (Request.Form (name), Chk_badword (i)) <>0 Then
Select case Err_ Message
Case "1"
Response.Write "<script language=javascript>alert (' Wrong! The value of the form ' &name& ' contains an illegal string! nn please do not appear in the form:% & * # () and other illegal characters! '); Window.close ();</script> "
case" 2 "
Response.Write" <script language=javascript> Location.href= ' "&Err_Web&" ' </Script> "
Case" 3 "
Response.Write" <script language= Javascript>alert (' a mistake! The value of the parameter ' &name& ' contains an illegal string! nn please do not appear in the form:% & * # () Such illegal characters! '); location.href= ' &Err_Web& ';</script> '
End Select
Response.End
End If
Next
Next
End If
%>