Several better ASP inspection functions

xiaoxiao2021-03-06  81

Because it is simple, I don't say anything. I will understand it!

Function Chkstr (Instring) if Instring <> "" "" ",", "")? Instring = Replace (LCase (Instring), ";", "")? Instring = Replace LCASE (Instring), "'" "" Instring = Replace (LCase (Instring), ",", "" Instring = Replace (LCase (Instring), "%", "") Instring = Replace (Instring), "% 20", "") ?? Instring = Replace (LCASE (Instring), "Admin", "" Instring = Replace (Lcase (Instring), "And", "" )? Instring = Replace (LCase (Instring), "OR", "")? INSTRING = Replace (LCase (Instring), "ASC", "" Instring = Replace (Lcase (Instring), "Chr", "")? Instring = Replace (LCASE (Instring), "MID", "" "Instring = Replace (LCASE (Instring)," Len "," "Instring = Replace (Lcase (Instring)," SELECT "," ")? INSTRING = Replace (Instring)," INSERT "," ")? Instring = Replace (LCase (Instring)," DELETE "," "Instring = Replace (LCase (Instring)," Update "," ") ??? chkstr = instructionendness impunction

Function CheckFileExt (FileExt)? Dim FileAccessExt, AccessExt? AccessExt = "gif, jpg, jpeg, bmp, doc, txt, png"? FileAccessExt = Split (AccessExt, ",")? For i = LBound (FileAccessExt) to UBound ( FileAccessext) ?? if Lcase (FileExt) = LCase (FileAcCessext (i)) THEN ??? checkfileext = true ?? Else ??? checkfileext = false ?? end if? Nextend function

Function Checkstr (STR, ISSTR) Checkstr = Strif Isstr And Instr (Str, ",")> 0 THEN? CALL ERRMSG ("submitted characters included illegal characters") Elseif (not isnumeric (STR)) THEN Call errmsg ("Submit Not Digital") Endness FunctionSub Errmsg (STR)? If not isnull (str) Then ?? Response.write (str) & "
" Call Ascpy () ?? response. End ()? 'Very Improtan.stop Execute Program "HREF =' css' Type = 'TEXT / CSS' TYPE = 'Text / CSS'" ? Response.write "

"

??? response.write ("

Error happed!

Please contact ")

? Response.write ("name:

")? Response.write (" AlOnesword ")? Response.write (".

Thank you !!!

")

? Response.write "

Copyright © by

Building large networkTM

"

??? response.write "Last Modified: 21/08/2004

"

? Response.write ("Author:

Alonesword ")

? Response.write "

"

End Sub

?

summary:

The most well-worthy of learning is a reasonable use of Response.end (), very good. As long as there is an error, the operation is immediately terminated, and the opportunity to be later will ensure the safety of the data.

转载请注明原文地址:https://www.9cbs.com/read-124052.html

New Post(0)