Jump to content

auto scan url for bad keywords return results


blogscrubber

Recommended Posts

Hi,

 

I'm working on a script to scan an url for adult keywords and having nothing but problems, please help!

 

$adult = array("lesbians", "porn");
for($i=0; $i<sizeof($adult); $i++) {   
if (preg_match($adult[$i],$website_uri)===false) {
	$website = 'block.gif';
} else {
	$website = 'accept.gif';
}
}  

 

please tell me what i'm doing wrong? should work, I think!

$website1 = 'accept.gif';

$adult = array("lesbians", "porn", "xxx", "pron");
foreach($adult as $word){
  if(strpos($website_uri, $word) == true){
	$website1 = 'blocked.gif';
    break;
  }
}

 

thank you so much, had to modify it a bit to get it to work!

works perfect now!  filled array!

the only catch is if the url string starts with one of the bad words (which theoretically will never happen), but just in case:

 

<?php
$website = 'accept.gif';
$adult = array("lesbians", "porn", "xxx", "pron");
foreach($adult as $word){
  if(strpos($website_uri,$word) !== false){
    $website = 'block.gif';
    break;
  }
}
?>

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.