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 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_32_class='form_7_info';
$form_7_td_32_error=' ';
$form_7_td_32_value='';
if ('ywdxptjn'==my_get_post('form_7_submit'))
{
$form_7_error_string='There are errors which need correction.';
$form_7_td_32_error_class='form_7_error';
$form_7_td_32_error_must='Error: This field is required!';
$form_7_td_32_error_spam='Error: http: < > are not allowed!';
$form_7_td_32_value=my_get_post('Note' ,true);
$form_7_body.='Note : '.my_get_post('Note')."\r\n";
if (''==trim(my_get_post('Note'))) {$form_7_td_32_class=$form_7_td_32_error_class; $form_7_td_32_error=$form_7_td_32_error_must; $form_7_error=$form_7_error_string;}
$form_7_td_32_spam=form_7_count_spam(my_get_post('Note'));
if ($form_7_td_32_spam>0)
{
if ($form_7_td_32_class!=$form_7_td_32_error_class) {$form_7_td_32_class=$form_7_td_32_error_class; $form_7_td_32_error=$form_7_td_32_error_spam; $form_7_error=$form_7_error_string;}
$form_7_spam += $form_7_td_32_spam;
}
if (''==trim($form_7_error) && 0==$form_7_spam)
{
$receiver='daniel@te-winkel.nl';
$subject='Note to self';
$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='';
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_32_value='';
?>
Daniël's portal