It doesn't work... the bas words are still there. Mind taking another look?
<?
function format_term($term) {
$term = str_replace('-','~~',$term);
return str_replace(' ','-',$term);
}
$res = mysql_query("SELECT * FROM $querytable ORDER BY q_id DESC") or die(mysql_error());
$bad_words = array('pthc rompl ranchi pthc pthc ranchi board', 'melissa midwest', 'melissa midwest movies');
$pattern = '%'.preg_quote(implode('|', $bad_words)).'%i';
if (preg_match($pattern, $searchstring)) {
do_insert();
}
while (($line = mysql_fetch_assoc($res)) && strlen(ob_get_contents()) < 95*1024) {
echo "<a href='".constant('dir')."search/".format_term($line['q_query'])."'>".$line['q_query']."</a><br>";
}
?>
</div>
Thanks.