Needle in a haystack

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

spacebiscuit
Forum Contributor
Posts: 390
Joined: Mon Mar 07, 2005 3:20 pm

Re: Needle in a haystack

Post by spacebiscuit »

Ok I figured it out.

Some of the words that I am searching for include "frame" "iframe" etc,. Since the 'replaced' array's index was given this value it was causing the items to be drawn when I dumped the variable. So I replaced the index naming with numbers which I can easily check to find the data.

To back track a little what I am trying to do is scan input for malicious code injection. Lumped in with the malicious words are some abusive words, if a malicious word was found I send an email alert. If an abusive/sewar word is found there is no need to send an email alert. What I needed was a way to differentiate between the two.

To solve the rpoblem I actually took a few steps back. I now run str_replace twice - once checking for malicious words, then a second time looking for abusive/swear words. This way I don't have to make the differentiation.

Thanks for your help guys.

Rob.
Post Reply