ACTIVE SERVER PAGE > function ¿¹Á¦ - Ư¼ö¹®ÀÚ Á¸Àç üũ
µî·ÏÀÏ : 2017-07-03 20:20
Á¶È¸¼ö : 53,143
str="aaaaa'b%"
str_chk=checkSpecialChar(str)
if str_chk="O" then
response.write " Ư¼ö¹®ÀÚ°¡ ÀÖ½À´Ï´Ù. "
else
response.write " Ư¼ö¹®ÀÚ°¡ ¾ø½À´Ï´Ù. "
end if
Function checkSpecialChar(expression)
checkSpecialChar="O"
strSpecial = "`~!@#$%^&*()_+|\;\\/:=-<>.'\ "
For i=1 to Len(expression)
For j=1 to Len(strSpecial)
if mid(expression,i,1)=mid(strSpecial,j,1) then
checkSpecialChar="X"
end if
next
Next
End Function
À§ÀÇ ¿¹¹®Àº Ư¼ö¹®ÀÚ¸¦ üũÇÏ´Â ¸ðµâÀÔ´Ï´Ù.
¾Æ·¡ ¼Ò½º´Â °Ô½ÃÆÇ ±Û¾²±â¿¡¼ Ư¼ö¹®ÀÚ º¯È¯ Function ÀÔ´Ï´Ù.
Function CheckWord(CheckValue)
CheckValue = replace(CheckValue, "&" , "&")
CheckValue = replace(CheckValue, "<", "<")
CheckValue = replace(CheckValue, ">", ">")
CheckValue = replace(CheckValue, "'", "''")
CheckWord = CheckValue
End Function