Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Closed Thread
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
Trades: 0
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
View Public Profile
 
 
Register now for full access!
Old 08-18-2006, 03:24 AM Re: How can I make a filtering PHP Function
Skilled Talker

Posts: 95
Trades: 0
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
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: 565
Name: surajit ray
Location: inside the heart of my friends
Trades: 0
http://ww.phpbuilder.com/columns/rya...n20060627.php3
just follow the tutorial.
you can also download php filtering classes.
jito is offline
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,226
Name: Mike
Location: Mataro, Spain
Trades: 0
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.
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE

And don't forget to give me talkupation!
mtishetsky is offline
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,226
Name: Mike
Location: Mataro, Spain
Trades: 0
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.
__________________

Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE
-
Please login or register to view this content. Registration is FREE

And don't forget to give me talkupation!
mtishetsky is offline
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
Trades: 0
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
View Public Profile
 
Old 08-18-2006, 04:31 AM Re: How can I make a filtering PHP Function
Skilled Talker

Posts: 95
Trades: 0
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
View Public Profile
 
Closed Thread     « Reply to How can I make a filtering PHP Function
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

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