StrBanned Function:
Ban form input containing unwanted text
Description:
StrBanned Function allow you to avoid form input containing bad or unwanted text, thus reducing spamming input to your form.
Syntax:
bool = StrBanned(strString)
Details:
Argument: strString: the input string to check Returns: true or false Note: Add your unwanted words to the Array
Example:
<%
Dim strText strText = Request.Form("messageText")
If Not strBanned(strText) Then '--- save or send the message End if
%>
ASP Source Code:
<%
Function StrBanned(strString) Dim aBadText, j strBanned = False aBadText = Array( _ "a href", _ "/link", _ "/url", _ "[link]", _ "[link=", _ "[url=", _ "gifts", _ "cgi-bin") For j = 0 To UBound(aBadText) If instr(LCase(strString), aBadText(j)) > 0 Then StrBanned = True End if Next End Function
%>
|