Reply
How can I make a filtering PHP Function
Old 08-18-2006, 02:07 AM How can I make a filtering PHP Function
Skilled Talker

Posts: 95
I have a family friendly directory but adult, and porn site webmasters keep submiting their dumb sites to my directory. Ok only a few but I don't want them and have to keep rejecting rulebreakers so I want to stop them.

Now my question is how can you make a filter to where if bad words get entered even if mixed with other words the form will not go further.

This is what I have so far but it has to be only the bad word alone submited to be rejected.
Code:
if ($ttitle=="$LANG[badword10]") $error.="<LI>".$LANG["bad_words"];
badword10 contains the bad word in the language file.
Also ttitle is the PHP coding Title of my Directory submission. $error displays "Your site is not allowed because your site contains adult/illegal/spam content."

Can anyone tweak this little code to where I can reject any site that uses that word no matter where they put it in a sentance.

Last edited by hyipo : 08-18-2006 at 02:10 AM.
hyipo is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 08-18-2006, 03:24 AM Re: How can I make a filtering PHP Function
Skilled Talker

Posts: 95
Please. I need to keep bad websites from attempting to try to submit them. Who knows they will probably spam me with tons of it and I will take forever to remove it.
hyipo is offline
Reply With Quote
View Public Profile
 
Old 08-18-2006, 03:37 AM Re: How can I make a filtering PHP Function
jito's Avatar
MY LIFE IS 'i' LIFE

Posts: 551
Name: surajit ray
Location: inside the heart of my friends
http://ww.phpbuilder.com/columns/rya...n20060627.php3
just follow the tutorial.
you can also download php filtering classes.
jito is offline
Reply With Quote
View Public Profile
 
Old 08-18-2006, 03:44 AM Re: How can I make a filtering PHP Function
mtishetsky's Avatar
King Spam Talker

Posts: 1,056
Name: Mike
Location: Mataro, Spain
PHP Code:
if (preg_match('!big|brown|fox|jumped|over|the|lazy|dog!i'$site_title)) {
   echo 
'u submitted crap u suck kekeke lol';

Next you may put all stop words into array or into a file one per line, implode with | and pass to preg_match() as specified above.
__________________
Free Mobile Phone Themes

And don't forget to give me talkupation!
mtishetsky is offline
Reply With Quote
View Public Profile Visit mtishetsky's homepage!
 
Old 08-18-2006, 03:49 AM Re: How can I make a filtering PHP Function
mtishetsky's Avatar
King Spam Talker

Posts: 1,056
Name: Mike
Location: Mataro, Spain
Also I recommend to put Captcha (that image with noise over digits which can be only recognized by human) on your site to prevent automated submissions. Something like PHP Classes - Class: PHP Captcha, though I use the captcha plugin for b2evolution as it perfectly works standalone, google for it.
__________________
Free Mobile Phone Themes

And don't forget to give me talkupation!
mtishetsky is offline
Reply With Quote
View Public Profile Visit mtishetsky's homepage!
 
Old 08-18-2006, 03:59 AM Re: How can I make a filtering PHP Function
Novice Talker

Posts: 6
Ow.. that's a toughie.

There is a very basic way I used to do, is using sub string counts... you know like for instance
PHP Code:
<?

$string 
"applebadwordhere";

$exp_check substr_count($string'badword');

if (
$exp_check >= 1) { echo "bad word detected!"; } else { echo "OK!"; }

?>
Well you can check it through a while loop within the function for each word - just a thought, there are better ways but i always follow the simpelest methods possible
vigilphp is offline
Reply With Quote
View Public Profile
 
Old 08-18-2006, 04:31 AM Re: How can I make a filtering PHP Function
Skilled Talker

Posts: 95
Thank you it worked. I can finally blocked bad sites. Now that will help me out.

I did better.

I am going to block sites that have bad words in their url, title, and description maybe email.

I can even use the PHP Function to block certain emails, or block spammers email addresses.

This will teach those adult sites a thing or too, and keep them from submiting to my site when it is against the rules, and it is obvious the directory is family friendly but they iqnore it.

Thank You!

Thank you mtishetsky, jito, and vigilphp for your participation.

Oh yeah did you know my site uses the
The iWatchDog™ Program certification. Now my directory will not be accidently blocked by filters

Last edited by hyipo : 08-18-2006 at 04:35 AM.
hyipo is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to How can I make a filtering PHP Function
 

Thread Tools

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
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.13672 seconds with 12 queries