ASP implementation to limit the Search keyword function _ application techniques

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
%>
Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.