<?
function ch_emspam()
{
global $photos_path, $HTTP_POST_VARS, $pm_message, $pm_email, $pm_subject, $REMOTE_ADDR, $msg2;

$fll_path=$photos_path."spamwrd.dat";
$spwstring="";

if (file_exists("$fll_path")){
$arr_wrds=file("$fll_path");
foreach ($arr_wrds as $arrwrd)
{
chop($arrwrd);
$spwstring=$spwstring.$arrwrd;
}
}
$spwstring=ereg_replace("\n", '', $spwstring);
$spwstring=ereg_replace("\r", '', $spwstring);
$dllmmt=',';
$arrswds=split($dllmmt,$spwstring);

$spamres="0";

foreach ($arrswds as $spmwrd)
{
$spmwrd1=ereg_replace(" ", '', $spmwrd);
if ($spmwrd1 !="")
{
if (preg_match("/$spmwrd/sU", $pm_message) ){$spamres="1";}
if (preg_match("/$spmwrd/sU", $pm_subject)){$spamres="1";}
if ($spmwrd==$pm_email){$spamres="1";}
if (($REMOTE_ADDR!="") and ($REMOTE_ADDR==$spmwrd)){$spamres="1";}
}
}

if($spamres=="1"){
$info_message="
<FONT FACE='Verdana,Geneva,Arial'   color='#990000'>
<b> ".$msg2['your_msg_not_sent']." </b>
</font>
";

output_message($info_message);
exit;
}

}

?>