Friday, August 31, 2012

how to check ban-word user in put using php

function banned_words_chk($phrase)
{
global $conn, $config;
$query = "SELECT word from bans_words";
$executequery = $conn->Execute($query);
$bwords = $executequery->getarray();
$found = 0;
$words = explode(" ", $phrase);
foreach($words as $word)
{
foreach($bwords as $bword)
{
if($word == $bword[0])
{
$found++;
}
else
{
$pos2 = strpos($word, $bword[0]);
if($pos2 !== false)
{
$found++;
}
}
}
}
if($found > 0)
{
return true;
}
else
{
return false;
}
}
-------------------------------------------------------------
if you helpful my code please donate some few amount to
developing and free to post.
-------------------------------------------------------------

No comments:

Post a Comment