function my_get_post($name,$escape=false)
{
$var_read = '';
if (isset($_POST[$name]))
{
$var_read = $_POST[$name];
if (get_magic_quotes_gpc()) $var_read=stripslashes($var_read);
if ($escape) $var_read=htmlspecialchars($var_read,ENT_QUOTES);
}
return $var_read;
}
function isEmail($str)
{
if(eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$", $str))
return true;
else
return false;
}
function form_7_count_spam($str)
{
$nb=0;
$word='http:';
if (stristr($str,$word)) $nb++;
$word='<';
if (stristr($str,$word)) $nb++;
$word='>';
if (stristr($str,$word)) $nb++;
return $nb;
}
$form_7_class='form_7_error';
$form_7_error='';
$form_7_spam=0;
$form_7_td_47_class='form_7_info';
$form_7_td_47_error=' ';
$form_7_td_47_value='';
$form_7_td_48_class='form_7_info';
$form_7_td_48_error=' ';
$form_7_td_48_value='';
$form_7_td_49_class='form_7_info';
$form_7_td_49_error=' ';
$form_7_td_49_value='';
$form_7_td_50_class='form_7_info';
$form_7_td_50_error=' ';
$form_7_td_50_value='';
$form_7_td_51_class='form_7_info';
$form_7_td_51_error=' ';
$form_7_td_51_value='';
if ('xipuwjhc'==my_get_post('form_7_submit'))
{
$form_7_error_string='There are errors which need correction.';
$form_7_td_47_error_class='form_7_error';
$form_7_td_47_error_must='Error: This field is required!';
$form_7_td_47_error_spam='Error: http: < > are not allowed!';
$form_7_td_47_value=my_get_post('Name' ,true);
$form_7_body.='Name : '.my_get_post('Name')."\r\n";
if (''==trim(my_get_post('Name'))) {$form_7_td_47_class=$form_7_td_47_error_class; $form_7_td_47_error=$form_7_td_47_error_must; $form_7_error=$form_7_error_string;}
$form_7_td_47_spam=form_7_count_spam(my_get_post('Name'));
if ($form_7_td_47_spam>0)
{
if ($form_7_td_47_class!=$form_7_td_47_error_class) {$form_7_td_47_class=$form_7_td_47_error_class; $form_7_td_47_error=$form_7_td_47_error_spam; $form_7_error=$form_7_error_string;}
$form_7_spam += $form_7_td_47_spam;
}
$form_7_td_48_error_class='form_7_error';
$form_7_td_48_error_spam='Error: http: < > are not allowed!';
$form_7_td_48_value=my_get_post('PhoneNumber' ,true);
$form_7_body.='PhoneNumber : '.my_get_post('PhoneNumber')."\r\n";
$form_7_td_48_spam=form_7_count_spam(my_get_post('PhoneNumber'));
if ($form_7_td_48_spam>0)
{
if ($form_7_td_48_class!=$form_7_td_48_error_class) {$form_7_td_48_class=$form_7_td_48_error_class; $form_7_td_48_error=$form_7_td_48_error_spam; $form_7_error=$form_7_error_string;}
$form_7_spam += $form_7_td_48_spam;
}
$form_7_td_49_error_class='form_7_error';
$form_7_td_49_error_spam='Error: http: < > are not allowed!';
$form_7_td_49_value=my_get_post('CompanyName' ,true);
$form_7_body.='CompanyName : '.my_get_post('CompanyName')."\r\n";
$form_7_td_49_spam=form_7_count_spam(my_get_post('CompanyName'));
if ($form_7_td_49_spam>0)
{
if ($form_7_td_49_class!=$form_7_td_49_error_class) {$form_7_td_49_class=$form_7_td_49_error_class; $form_7_td_49_error=$form_7_td_49_error_spam; $form_7_error=$form_7_error_string;}
$form_7_spam += $form_7_td_49_spam;
}
$form_7_td_50_error_class='form_7_error';
$form_7_td_50_error_must='Error: This field is required!';
$form_7_td_50_error_validation='Error: This field must be an email!';
$form_7_td_50_error_spam='Error: http: < > are not allowed!';
$form_7_td_50_value=my_get_post('EmailAddress' ,true);
$form_7_body.='EmailAddress : '.my_get_post('EmailAddress')."\r\n";
if (''==trim(my_get_post('EmailAddress'))) {$form_7_td_50_class=$form_7_td_50_error_class; $form_7_td_50_error=$form_7_td_50_error_must; $form_7_error=$form_7_error_string;}
if ($form_7_td_50_class!=$form_7_td_50_error_class && ''!=trim(my_get_post('EmailAddress')) && !isEmail(my_get_post('EmailAddress'))) {$form_7_td_50_class=$form_7_td_50_error_class; $form_7_td_50_error=$form_7_td_50_error_validation; $form_7_error=$form_7_error_string;}
$form_7_td_50_spam=form_7_count_spam(my_get_post('EmailAddress'));
if ($form_7_td_50_spam>0)
{
if ($form_7_td_50_class!=$form_7_td_50_error_class) {$form_7_td_50_class=$form_7_td_50_error_class; $form_7_td_50_error=$form_7_td_50_error_spam; $form_7_error=$form_7_error_string;}
$form_7_spam += $form_7_td_50_spam;
}
$form_7_td_51_error_class='form_7_error';
$form_7_td_51_error_must='Error: This field is required!';
$form_7_td_51_error_spam='Error: http: < > are not allowed!';
$form_7_td_51_value=my_get_post('Comments' ,true);
$form_7_body.='Comments : '.my_get_post('Comments')."\r\n";
if (''==trim(my_get_post('Comments'))) {$form_7_td_51_class=$form_7_td_51_error_class; $form_7_td_51_error=$form_7_td_51_error_must; $form_7_error=$form_7_error_string;}
$form_7_td_51_spam=form_7_count_spam(my_get_post('Comments'));
if ($form_7_td_51_spam>0)
{
if ($form_7_td_51_class!=$form_7_td_51_error_class) {$form_7_td_51_class=$form_7_td_51_error_class; $form_7_td_51_error=$form_7_td_51_error_spam; $form_7_error=$form_7_error_string;}
$form_7_spam += $form_7_td_51_spam;
}
if (''!=trim(my_get_post('yourname'))) $form_7_spam += 10;
if (''!=trim(my_get_post('street'))) $form_7_spam += 10;
if (''!=trim(my_get_post('yourstreet'))) $form_7_spam += 10;
if (''!=trim(my_get_post('address'))) $form_7_spam += 10;
if (''!=trim(my_get_post('yourname2'))) $form_7_spam += 10;
if (''!=trim(my_get_post('phone'))) $form_7_spam += 10;
if (''!=trim(my_get_post('yourphone'))) $form_7_spam += 10;
if (''==trim($form_7_error) && 0==$form_7_spam)
{
$receiver='sales@ccssystems.com';
$subject='Website Feedback';
if (isEmail( $form_7_td_50_value )) $header='From: '.$form_7_td_50_value;
$subject= substr($subject, 0, 255);
$subject=str_replace("\n", " ", $subject);
$subject=str_replace("\r", " ", $subject);
$body=str_replace("\n.", "\n..", $form_7_body);
if ($body!="")
{
$result=mail($receiver,$subject,$body,$header);
if (!result)
{
echo 'ERROR: The PHP mail function mail($receiver,$subject,$body,$header); does not work properly on your server, please contact your web hosting.';
exit;
}
}
if ($result)
{
$url='http://www.ccssystems.com/home.htm';
if (!headers_sent()){
header('Location: '.$url); exit;
}else{
echo '';
echo ''; exit;
}
exit;
}
}
if (trim($form_7_error)) $form_7_error="
$form_7_error
";
}
if ($form_7_spam >= 3) sleep(20);
if ($form_7_spam >= 3) $form_7_td_47_value='';
if ($form_7_spam >= 3) $form_7_td_48_value='';
if ($form_7_spam >= 3) $form_7_td_49_value='';
if ($form_7_spam >= 3) $form_7_td_50_value='';
if ($form_7_spam >= 3) $form_7_td_51_value='';
?>
Network and Telecommunications Experts