Jump to content

Trouble getting my "naughty words" function to work


Jeffro

Recommended Posts

okay..  so I found a list of bad words on line that I want to work into my website's insert.  I took the time to create a long comma-delimited list and I'm trying to use this in my page but I keep getting errors.  I'm not sure what I'm supposed to be escaping because of the many numerous characters in this list.  Might someone help?  As I didn't want to post a bunch of foul words on this forum, I posted it here:  http://snipt.org/xmpgk 

 

You might not want to visit if you don't like bad words.  :)

 

As the list currently is, I'm getting this error:

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in /home/jeffro/public_html/all/xyzman/inserttodb.php on line 114

 

....right on the line where $newwords begins.

Link to comment
Share on other sites

You have 2 spots in the second array where it's missing a quote.

 

Making the second array to replace is the hard way to go about this.

 

http://get.blogdns.com/dynaindex/Safe-Filter/

 

Here's my bad words safe filter with the code below to give you an alternate way.

 

Thanks, QuickOldCar.  A far different approach.  I didn't figure mine was the best but it does work. 

Appreciate it!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.