session_start(); ?>
Contact Us - Times of Swaziland
$badwordcount = 0;
if ($_POST['tcomment']) {
$t_comment = strlen($_POST['tcomment'])>400 ? substr($_POST['tcomment'],0,10000) : $_POST['tcomment'];
function filterBadWords($str){
global $badwordcount;
$pos = true;
$badwords=array( "xxx", "teens", "sex", "viagra", "naked", "http:" );
for($i=0;$i < sizeof($badwords);$i++){
$pos = strpos($str, $badwords[$i]);
if ($pos !== false) {
$badwordcount++;
}
}
if ($badwordcount>0) {
$str = '';
}
return $str;
}
$t_comment = filterBadWords($t_comment);
}
if (($_POST['tname'] && $_POST['imgword']==$_SESSION['confirmtext']) && (strlen($t_comment)>0)){
$t_name = $_POST['tname'];
$t_email = $_POST['temail'];
$t_reason = $_POST['treason'];
$mailbody = '| Website Comment |
';
$mailbody .= '| Name: | '.$t_name." |
";
$mailbody .= '| Email Address: | '.$t_email." |
";
$mailbody .= '| Reason for Correspondence: | '.$t_reason." |
";
$mailbody .= '| Comments: | '.$t_comment." |
";
// echo $mailbody;
@mail("swazinews@times.co.sz,sundayeditor@times.co.sz,adverts@times.co.sz,editor@times.co.sz,submitter@times.co.sz,seanm@times.co.sz,entertainment@times.co.sz,news@times.co.sz,business@times.co.sz,sports@times.co.sz ","Times of Swaziland Website",$mailbody,"From: $t_email\r\nContent-Type: text/html; charset=iso-8859-1");
echo "";
} else {
if ($badwordcount>0) {
?>
}
?>
} ?>