Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
Bad Word filter for CGI Script?
Old 04-29-2004, 09:40 AM Bad Word filter for CGI Script?
Dale Hodge's Avatar
Skilled Talker

Posts: 63
Location: Syracuse, ny
Trades: 1
Hello all,

I have just installed a neat little soutbox clone on the main page of my website. Problem is, right now I am using javascript to filter out bad words and would rather have it programmed with perl for CGI control. Anyone out there with a code snipplet for such an Idea? Any help would be greatly appreciated.

Thanks in advance,

Dale.

http://www.bestdjsite.com
Dale Hodge is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 04-30-2004, 11:00 AM
Skilled Talker

Posts: 75
Location: New Jersey, USA
Trades: 0
This is not tested!
Code:
@badwords=('bad','word','list','here');
foreach $badword (@badwords) {
    if ($string_to_test =~ /$badword/gi) { 
	$highlight_the_bad_word =~ s/($badword)/<B>$1<\/B>/gi;
        #return an error here
    }
}
__________________

Please login or register to view this content. Registration is FREE

Where you can get personal, online!

Last edited by eBlush_Hector; 04-30-2004 at 11:02 AM.. Reason: Added code tags
eBlush_Hector is offline
Reply With Quote
View Public Profile Visit eBlush_Hector's homepage!
 
Old 05-03-2004, 12:02 AM
Dale Hodge's Avatar
Skilled Talker

Posts: 63
Location: Syracuse, ny
Trades: 1
Quote:
Originally Posted by eBlush_Hector
This is not tested!
Code:
@badwords=('bad','word','list','here');
foreach $badword (@badwords) {
    if ($string_to_test =~ /$badword/gi) { 
	$highlight_the_bad_word =~ s/($badword)/<B>$1<\/B>/gi;
        #return an error here
    }
}
It worked better than I thought! Thanks for taking the time to help me out.

Dale.
http://www.bestdjsite.com
Dale Hodge is offline
Reply With Quote
View Public Profile
 
Old 05-03-2004, 12:05 AM
Skilled Talker

Posts: 75
Location: New Jersey, USA
Trades: 0
Sweet!
You're welcome
__________________

Please login or register to view this content. Registration is FREE

Where you can get personal, online!
eBlush_Hector is offline
Reply With Quote
View Public Profile Visit eBlush_Hector's homepage!
 
Reply     « Reply to Bad Word filter for CGI Script?
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.13168 seconds with 12 queries