Set the following
Code Copy to the header of each file to prevent SQL injection.
Program Security is the most important :)
<%
Dim fy_url, fy_a, fy_x, fy_cs (), fy_cl, fy_ts, fy_zx
'--- Define partial headers ------
Fy_cl = 1' Processing Method: 1 = prompt message, 2 = redirect page, 3 = Prompt before redirect
Fy_zx = "error. asp" 'page to be switched when an error occurs
'--- Define the end of part ------
On Error resume next
Fy_url = request. servervariables ("QUERY_STRING ")
Fy_a = Split (fy_url ,"&")
Redim fy_cs (ubound (fy_a ))
On Error resume next
For fy_x = 0 to ubound (fy_a)
Fy_cs (fy_x) = left (fy_a (fy_x), instr (fy_a (fy_x), "=")-1)
Next
For fy_x = 0 to ubound (fy_cs)
If fy_cs (fy_x) <> "" then
If instr (lcase (Request (fy_cs (fy_x), "'") <> 0 or instr (lcase (Request (fy_cs (fy_x), "and ") <> 0 or instr (lcase (Request (fy_cs (fy_x), "select") <> 0 or instr (lcase (Request (fy_cs (fy_x ))), "Update") <> 0 or instr (lcase (Request (fy_cs (fy_x), "CHR ") <> 0 or instr (lcase (Request (fy_cs (fy_x), "Delete % 20 from ") <> 0 or instr (lcase (Request (fy_cs (fy_x), ";") <> 0 or instr (lcase (Request (fy_cs (fy_x ))), "insert") <> 0 or instr (lcase (Request (fy_cs (fy_x), "mid ") <> 0 or instr (lcase (Request (fy_cs (fy_x), "Master. ") <> 0 then
Select case fy_cl
Case "1"
Response. Write "<script language = JavaScript> alert ('error! The value of the parameter "& fy_cs (fy_x) &" contains an invalid string! \ N do not contain invalid characters such as;, and, select, update, insert, delete, and CHR in the parameter! \ N what do you want! Don't be bored! Thank you! '); Window. Close (); </SCRIPT>"
Case "2"
Response. Write "<script language = JavaScript> location. href = '" & fy_zx & "' </SCRIPT>"
Case "3"
Response. Write "<script language = JavaScript> alert ('error! The value of the parameter "& fy_cs (fy_x) &" contains an invalid string! \ N do not contain invalid characters such as;, and, select, update, insert, delete, and CHR in the parameter! \ N what do you want! Don't be bored! Thank you! '); Location. href =' "& fy_zx &" '; </SCRIPT>"
End select
Response. End
End if
End if
Next
%>