Wrox Programmer Forums
|
Classic ASP Basics For beginner programmers starting with "classic" ASP 3, pre-".NET." NOT for ASP.NET 1.0, 1.1, or 2.0
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Classic ASP Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 5th, 2004, 12:34 PM
Registered User
 
Join Date: Oct 2003
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to filter curse words from discussion board?

There is one discussion board on our web site to let users submit their question freely but we want set up a language fileter to detect/avoid some unnecessary words such as curse words. How to do it? Are there any language filter software on the market?

 
Old January 5th, 2004, 07:38 PM
Authorized User
 
Join Date: Jun 2003
Posts: 14
Thanks: 0
Thanked 0 Times in 0 Posts
Default

if the board is in asp:

make an extra table in your db: tblCurseWords with 2 fields:
CurseWord and ReplacingWord

Then, take a look at the scripts of your board, and find the place where the form-inputfield is passed to your database.

In most cases there is already some manipulation there (htmlencode, or replacing eol's with <br>, etc.)

At this place, lets say your formfield is called TextField, and it is put into strTextField (example: strTextField=request.form("TextField") ), if you found this place, after this you do your own manipulation:

dim ObjConn,rsCurseWords,strSQL

set Objconn = Server.CreateObject("ADODB.Connection") 'if connection not already open
Objconn.open "...." 'idem
set rsCursedWords = Server.CreateObject("ADODB.Recordset")
strSQL="select * from TblCurseWords;"
rsCurseWords.open strSQL,Objconn

while not rsCurseWords.EOF
replace(StrTextField,rsCurseWords("CurseWord"),rsC urseWords("ReplacingWord"))
rsCurseWords.MoveNext
wend

rsCurseWords.close
set rsCursWords = nothing
ObjConn.close
set ObjConn = nothing



Something like this
bye,
mndrx





Similar Threads
Thread Thread Starter Forum Replies Last Post
c discussion forum giri_nitr C++ Programming 0 April 30th, 2007 05:44 AM
Discussion board customization marclena SharePoint Development 0 September 7th, 2006 10:40 AM
Other forums for DotNetNuke discussion jminatel BOOK: Professional DotNetNuke ASP.NET Portals ISBN: 0-7645-9563-6 1 March 9th, 2006 05:32 PM
discussion forum for local use Ulhas Amrite SQL Server 2000 1 April 15th, 2005 09:16 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.