Jump to content

Recommended Posts

While my site was online, i started to notice members/guest using my search page for certin words i find wrong, and feel should be banned!

 

It was both male and female users witch surprised and shocked me, i did not

think of it before i seen them searching these words.

 

For last week i have been re-building it but am stuck on the banned keyword part... i can get it to limit words one, buy one but not in full sentences.

 

example:

preteen girls live on cam.

It's suppost to say banned word.

 

preteen is a banned word, but only removes it if it is alone, here lies my issue how can i make it remove it if there is other words in the search?

 

I have several banned words but i have to make an if statement for each one i bann.

 

// SET BANNED WORDS
if($search_txt == "preteen"){ header("Location: illegal_action.php?action=key_illegal(preteen)"); }
if($search_txt == "underage"){ header("Location: illegal_action.php?action=key_illegal(underage)"); }

if($search_txt == "nigeria"){ header("Location: illegal_action.php?action=key_illegal(nigeria)"); }
if($search_txt == "credit card"){ header("Location: illegal_action.php?action=key_illegal(credit_card)"); }
if($search_txt == "trade accounts"){ header("Location: illegal_action.php?action=key_illegal(trade_accounts)"); }
if($search_txt == "sell password"){ header("Location: illegal_action.php?action=key_illegal(sell_password)"); }

 

Is there a way to make it read the banned word even if the user adds more to it?

 

Thanks in advanced, Breana

Link to comment
https://forums.phpfreaks.com/topic/164861-banned-keyword-need-help/
Share on other sites

$search = array('preteen girls', 'nigerian porn', 'sell password', 'credit card', 'trade accounts');
$replace = "banned word";

if(count(preg_filter($pattern, $replace, $search_txt)) != 0)
   header("Location: illegal_action.php?action=key_illegal($search_txt)");

 

Code not tested

 

EDIT CODE!! review it

Thanks for the reply, i tried array once before but i could not get it to load the banned page correctly...

Because my banned page is where it records there IP, time, keyword used and member name.

 

Update: i see you have the link different from the way i had it will try it out.

Also; searching for the keyword Nigeria should NOT be considered an illegal action - at least not in the sense that you tell the user so.

 

 

 

Actually the keyword (Nigeria) was cut off.

It's part of a larger system i have for scammer emails listed in search results.

The name will black list any member from that email with -10 NEG feedback.

 

And then load the banned page, but it will display a result why.

It's doing the same this it did to me yesterday, Fatal error: Call to undefined function preg_filter() in C:\wamp\www\site_search.php on line 23

 

I don't need it to "replace" the word, just load the url to the banned page.

I may have altered it wrong  O.o lol.

 

// SET BANNED WORDS
$search = array('preteen', 'nigerian', 'sell password', 'credit card', 'trade accounts');

if(count(preg_filter($search)) != 0)
   header("Location: illegal_action.php?action=key_illegal(banned)");

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.