By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,740 Members | 1,350 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,740 IT Pros & Developers. It's quick & easy.

replace function

100+
P: 118
As part of a project I have made a chatbox on my website

MyChatBox (best viewed in FireFox)

I was thinking of keeping it 'clean', so if people submit a word which could be of offense to anyone (f..., c... words, etc..), the code changes said word to 4 stars "****".

What code would I need in order to do this?

Thanks, Sam
Oct 15 '07 #1
Share this Question
Share on Google+
3 Replies


ronverdonk
Expert 2.5K+
P: 4,258
When the text is enterd/submitted, check the word against a 'dirty-word' array and replace the content when such a word is found.

When you use a server side language you can store the dirty words in a database.

Show the code you have sofar and we'll discuss it.

Ronald
Oct 15 '07 #2

100+
P: 118
Hey, I worked out a way to do it in php instead. Thanks for the response though,

Kind Regards,

Sam. =)
Oct 15 '07 #3

ronverdonk
Expert 2.5K+
P: 4,258
Hey, I worked out a way to do it in php instead. Thanks for the response though,

Kind Regards,

Sam. =)
That's what I meant by using a server side language (such nas PHP)

Ronald
Oct 15 '07 #4

Post your reply

Sign in to post your reply or Sign up for a free account.