ASP Tutorial Delete database tutorial Records in fact, in the ASP is very easy to do things, as long as the connection to the database, and then use the SQL Delete function to delete the OK, let's take a look at the example.
id = saferequest ("id")
Sql= "Delete from table1 where whereid>" &id& "
Rs.Open sql,conn,1,3
Response.Write "<script>alert (' delete success '); location.href= ' del.asp ';</script>"
Set rs=nothing
Set conn=nothing
This is the filter illegal character function
Function Saferequest (paraname)
Dim paravalue
Paravalue=request (paraname)
If IsNumeric (paravalue) = True Then
Saferequest=paravalue
Exit Function
ElseIf InStr (LCase (Paravalue), "select") > 0 or InStr (LCase ( Paravalue), "Insert") > 0 or InStr (LCase (Paravalue), "delete from") > 0 or InStr (LCase (Paravalue), "Count (") > 0 or InStr (LCase (Paravalue), "drop table") > 0 or InStr (LCase (Paravalue), "Update") > 0 or InStr (LCase (Paravalue), "trunc Ate ") > 0 or InStr (LCase (Paravalue)," ASC (") > 0 or InStr (LCase (Paravalue)," Mid (") > 0 or InStr (LCase (Paravalue), "Char (") > 0 or InStr (LCase (Paravalue), "xp_cmdshell") > 0 or InStr (LCase (Paravalue), "exec master") > 0 or InStr (l Case (Paravalue), "net localgroup Administrators") > 0 or InStr (LCase (Paravalue), "and") > 0 or InStr (LCase (Paravalue ), "net user" > 0 or InStr (LCase (Paravalue), "or") > 0 or InStr (LCase (Paravalue), "" ") >0 or InStr (LCase (Paravalu e), "'" >0 then
RESPONSE.WRIte "Please do not add illegal characters to the function!" '
Response.End
Else
Saferequest=paravalue
End If
End Function