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_8_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_8_class='form_8_error';
$form_8_error='';
$form_8_spam=0;
$form_8_td_41_class='form_8_info';
$form_8_td_41_error=' ';
$form_8_td_41_value='';
$form_8_td_42_class='form_8_info';
$form_8_td_42_error=' ';
$form_8_td_42_value='';
$form_8_td_43_class='form_8_info';
$form_8_td_43_error=' ';
$form_8_td_43_value='';
if ('iqyGOW4c'==my_get_post('form_8_submit'))
{
$form_8_error_string='There are errors which need correction.';
$form_8_td_41_error_class='form_8_error';
$form_8_td_41_error_must='Error: This field is required!';
$form_8_td_41_error_spam='Error: http: < > are not allowed!';
$form_8_td_41_value=my_get_post('Nome' ,true);
$form_8_body.='Nome : '.my_get_post('Nome')."\r\n";
if (''==trim(my_get_post('Nome'))) {$form_8_td_41_class=$form_8_td_41_error_class; $form_8_td_41_error=$form_8_td_41_error_must; $form_8_error=$form_8_error_string;}
$form_8_td_41_spam=form_8_count_spam(my_get_post('Nome'));
if ($form_8_td_41_spam>0)
{
if ($form_8_td_41_class!=$form_8_td_41_error_class) {$form_8_td_41_class=$form_8_td_41_error_class; $form_8_td_41_error=$form_8_td_41_error_spam; $form_8_error=$form_8_error_string;}
$form_8_spam += $form_8_td_41_spam;
}
$form_8_td_42_error_class='form_8_error';
$form_8_td_42_error_must='Error: This field is required!';
$form_8_td_42_error_validation='Error: This field must be an email!';
$form_8_td_42_error_spam='Error: http: < > are not allowed!';
$form_8_td_42_value=my_get_post('Email' ,true);
$form_8_body.='Email : '.my_get_post('Email')."\r\n";
if (''==trim(my_get_post('Email'))) {$form_8_td_42_class=$form_8_td_42_error_class; $form_8_td_42_error=$form_8_td_42_error_must; $form_8_error=$form_8_error_string;}
if ($form_8_td_42_class!=$form_8_td_42_error_class && ''!=trim(my_get_post('Email')) && !isEmail(my_get_post('Email'))) {$form_8_td_42_class=$form_8_td_42_error_class; $form_8_td_42_error=$form_8_td_42_error_validation; $form_8_error=$form_8_error_string;}
$form_8_td_42_spam=form_8_count_spam(my_get_post('Email'));
if ($form_8_td_42_spam>0)
{
if ($form_8_td_42_class!=$form_8_td_42_error_class) {$form_8_td_42_class=$form_8_td_42_error_class; $form_8_td_42_error=$form_8_td_42_error_spam; $form_8_error=$form_8_error_string;}
$form_8_spam += $form_8_td_42_spam;
}
$form_8_td_43_error_class='form_8_error';
$form_8_td_43_error_must='Error: This field is required!';
$form_8_td_43_error_spam='Error: http: < > are not allowed!';
$form_8_td_43_value=my_get_post('Commenti' ,true);
$form_8_body.='Commenti : '.my_get_post('Commenti')."\r\n";
if (''==trim(my_get_post('Commenti'))) {$form_8_td_43_class=$form_8_td_43_error_class; $form_8_td_43_error=$form_8_td_43_error_must; $form_8_error=$form_8_error_string;}
$form_8_td_43_spam=form_8_count_spam(my_get_post('Commenti'));
if ($form_8_td_43_spam>0)
{
if ($form_8_td_43_class!=$form_8_td_43_error_class) {$form_8_td_43_class=$form_8_td_43_error_class; $form_8_td_43_error=$form_8_td_43_error_spam; $form_8_error=$form_8_error_string;}
$form_8_spam += $form_8_td_43_spam;
}
if (''==trim($form_8_error) && 0==$form_8_spam)
{
$receiver='davide2791@tiscali.it';
$subject='riparazione carburatori';
if (isEmail( $form_8_td_42_value )) $header='From: '.$form_8_td_42_value;
$subject.=$form_8_td_41_value;
$subject= substr($subject, 0, 255);
$subject=str_replace("\n", " ", $subject);
$subject=str_replace("\r", " ", $subject);
$body=str_replace("\n.", "\n..", $form_8_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.riparazionecarburatori.it/services.php';
if (!headers_sent()){
header('Location: '.$url); exit;
}else{
echo '';
echo ''; exit;
}
exit;
}
}
if (trim($form_8_error)) $form_8_error="
$form_8_error
";
}
if ($form_8_spam >= 3) sleep(20);
if ($form_8_spam >= 3) $form_8_td_41_value='';
if ($form_8_spam >= 3) $form_8_td_42_value='';
if ($form_8_spam >= 3) $form_8_td_43_value='';
?>
RIPARAZIONE CARBURATORI