ColdFusion Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsProgramming Languages - MoreColdFusion Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old February 5th, 2004, 10:09 AM
bwedekin bwedekin is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Dubai, UAE
Posts: 449 bwedekin User rank is Corporal (100 - 500 Reputation Level)bwedekin User rank is Corporal (100 - 500 Reputation Level)bwedekin User rank is Corporal (100 - 500 Reputation Level)bwedekin User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 3 Days 22 h 51 m 39 sec
Reputation Power: 13
checking string submitted in form for expletives

I have a username/password fucntion created for part of my website, and I would like to figure out a way to filter out foul language in either their password or username. How can I create a string of expletives and have it search their username or password to see if they are in the name somewhere?

Thanks!

Reply With Quote
  #2  
Old February 5th, 2004, 01:01 PM
kiteless kiteless is offline
Moderator
Dev Shed God (5000 - 5499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 5,091 kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level) 
Time spent in forums: 2 Weeks 5 Days 2 h 53 m 27 sec
Reputation Power: 966
Yes, you can use findNoCase() to do this. In fact, you can easily combine a list of words with the find, in case the user name has a bad word in it anywhere, even if it is combined with another word. Something like this:

<cfset badWordList = "word1,word2" />
<cfloop list="#badWordList#" index="thisWord">
<cfif findNoCase( thisWord, form.userName )>
bad word found code goes here...
</cfif>
</cfloop>

Reply With Quote
  #3  
Old February 6th, 2004, 08:29 AM
bwedekin bwedekin is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2003
Location: Dubai, UAE
Posts: 449 bwedekin User rank is Corporal (100 - 500 Reputation Level)bwedekin User rank is Corporal (100 - 500 Reputation Level)bwedekin User rank is Corporal (100 - 500 Reputation Level)bwedekin User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 3 Days 22 h 51 m 39 sec
Reputation Power: 13
what is the function of index="thisWord"?

Reply With Quote
  #4  
Old February 6th, 2004, 08:53 AM
kiteless kiteless is offline
Moderator
Dev Shed God (5000 - 5499 posts)
 
Join Date: Jun 2002
Location: Raleigh, NC
Posts: 5,091 kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level)kiteless User rank is General (90000 - 100000 Reputation Level) 
Time spent in forums: 2 Weeks 5 Days 2 h 53 m 27 sec
Reputation Power: 966
For a list loop, the index hold the current list element.

For future reference, questions like this are easily resolved with a quick look at the documentation:

http://livedocs.macromedia.com/cold.../6.1/index.html

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreColdFusion Development > checking string submitted in form for expletives

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap