Tutorials to .com

Tutorials to .com » Asp » Optimization » ASP filter special characters

ASP filter special characters

Print View , by: iSee ,Total views: 7 ,Word Count: 207 ,Date: Fri, 17 Apr 2009 Time: 4:04 PM

Hey, do not write anything for a long time, this time for teachers to allow me to test to test their own things, found that strict filtering special characters, so once again to write a filter function of the special characters.

Function ChkInvaildWord (Words)
Const InvaildWords = "select | update | delete | insert |@|--|," 'need to filter the characters have to" | "separated from the end of the last character must be |

ChkInvaildWord = True
InvaildWord = Split (InvaildWords ,"|")
inWords = LCase (Trim (Words))

For i = LBound (InvaildWord) To UBound (InvaildWord)
If Instr (inWords, InvaildWord (i))> 0 Then
ChkInvaildWord = True
Exit Function
End If
Next
ChkInvaildWord = False
End Function

Relatively simple, do not use that.

But by the beginning of preparations for each ... next write, but do not know why that is wrong, so to switch to a for cycle, the feeling of discomfort is that, but you can use!
(Ps: headache today for a whole day, and do not know when this bloody headache to good, otherwise, tomorrow I can work the residue! Look forward to tomorrow, there will be a good state!)



Asp Optimization Articles


Can't Find What You're Looking For?


Rating: Not yet rated

Comments

No comments posted.