ASP implementation to limit the Search keyword function _ application techniques
Last Update:2017-01-18
Source: Internet
Author: User
<%
'******************************
' Function: Checkquery (ByVal str)
' parameter: str----the search string
' Author: Arisisi
' Date: 2007/7/15
' Description: Limit search keywords
' Example: Checkquery (str)
'******************************
Public Function checkquery (ByVal str)
Dim fobwords, I, keyword
Keyword = str
On Error Resume Next
Fobwords = Array (91, 92, 304, 305, 430, 431, 437, 438, 12460, 12461, 12462, 12463, 12464, 12465, 12466, 12467, 12468, 1246 9, 12470, 12471, 12472, 12473, 12474, 12475, 12476, 12477, 12478, 12479, 12480, 12481, 12482, 12483, 12485, 12486, 12487, 12488, 12489, 12490, 12496, 12497, 12498, 12499, 12500, 12501, 12502, 12503, 12504, 12505, 12506, 12507, 12508, 12509, 125 10, 12532, 12533, 65339, 65340)
For i = 1 to UBound (fobwords, 1)
If InStr (keyword, ChrW (fobwords (i))) > 0 Then
Checkquery = False
Exit Function
End If
Next
fobwords = array ("~", ) ", " @ ", " # ", " $ ", "% ", " ^ ", " & ", " * ", " (", ") ", " _ ", " + ", " = ", " ", " [", "] ", " {", ", "; ", ": ", " "" ", " ", " < ", " > ", ". ", "/", " \ ", ", "? ", " about ", " after ", " All ", " also ", " an ", " and ", " another ", " any ", " are ", " as ", " at ", " is ", " because ", " been ", " before ", " Being ", " "Between", "both", "but", "by", "came", "can", "Come", "could" , "did", "Do", "all", "for", "to", "get", "got", "had", "has", "have", "he", "her", "here", "him", "himself", "him", "how", "if ', ' in ', ' into ', ' is ', ' it ', ' like ', ' make ', ' many ', ' me ', ' might ", ", " Most ", " much ", " must ", " I ", " Never ", " Now ", " to ", " on ", " only ", "or", "other", "we", "out", "over", "said", "Same", "" ", " "should", "Since", "some", "still", "such", "Take", "than", "that", "the", "their", "them", "then", "there", "these", "they", "this")
Keyword = left (keyword, 100)
Keyword = Replace (keyword, "!", "")
Keyword = Replace (keyword, "]", "")
Keyword = Replace (keyword, "[", "")
Keyword = Replace (keyword, ")", "")
Keyword = Replace (keyword, "(", "")
Keyword = Replace (keyword, "", "")
Keyword = Replace (keyword, "-", "")
Keyword = Replace (keyword, "/", "")
Keyword = Replace (keyword, "+", "")
Keyword = Replace (keyword, "=", "")
Keyword = Replace (keyword, ",", "")
Keyword = Replace (keyword, "'", "")
For i = 0 to UBound (fobwords, 1)
If keyword = fobwords (i) Then
Checkquery = False
Exit Function
End If
Next
Checkquery = True
End Function
%>