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_5_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;
}
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;
}
$form_5_class='form_5_error';
$form_5_error='';
$form_5_spam=0;
$form_5_td_28_class='form_5_info';
$form_5_td_28_error=' ';
$form_5_td_28_value='';
$form_5_td_29_class='form_5_info';
$form_5_td_29_error=' ';
$form_5_td_29_value='';
$form_5_td_30_class='form_5_info';
$form_5_td_30_error=' ';
$form_5_td_30_value='';
$form_5_td_31_class='form_5_info';
$form_5_td_31_error=' ';
$form_5_td_31_value='';
$form_5_td_32_class='form_5_info';
$form_5_td_32_error=' ';
$form_5_td_32_value='';
if ('zlligcjg'==my_get_post('form_5_submit'))
{
$form_5_error_string='There are errors which need correction.';
$form_5_td_28_error_class='form_5_error';
$form_5_td_28_error_must='Error: This field is required!';
$form_5_td_28_error_spam='Error: http: < > are not allowed!';
$form_5_td_28_value=my_get_post('Name' ,true);
$form_5_body.='Name : '.my_get_post('Name')."\r\n";
if (''==trim(my_get_post('Name'))) {$form_5_td_28_class=$form_5_td_28_error_class; $form_5_td_28_error=$form_5_td_28_error_must; $form_5_error=$form_5_error_string;}
$form_5_td_28_spam=form_5_count_spam(my_get_post('Name'));
if ($form_5_td_28_spam>0)
{
if ($form_5_td_28_class!=$form_5_td_28_error_class) {$form_5_td_28_class=$form_5_td_28_error_class; $form_5_td_28_error=$form_5_td_28_error_spam; $form_5_error=$form_5_error_string;}
$form_5_spam += $form_5_td_28_spam;
}
$form_5_td_29_error_class='form_5_error';
$form_5_td_29_error_must='Error: This field is required!';
$form_5_td_29_error_validation='Error: This field must be an email!';
$form_5_td_29_error_spam='Error: http: < > are not allowed!';
$form_5_td_29_value=my_get_post('Email' ,true);
$form_5_body.='Email : '.my_get_post('Email')."\r\n";
if (''==trim(my_get_post('Email'))) {$form_5_td_29_class=$form_5_td_29_error_class; $form_5_td_29_error=$form_5_td_29_error_must; $form_5_error=$form_5_error_string;}
if ($form_5_td_29_class!=$form_5_td_29_error_class && ''!=trim(my_get_post('Email')) && !isEmail(my_get_post('Email'))) {$form_5_td_29_class=$form_5_td_29_error_class; $form_5_td_29_error=$form_5_td_29_error_validation; $form_5_error=$form_5_error_string;}
$form_5_td_29_spam=form_5_count_spam(my_get_post('Email'));
if ($form_5_td_29_spam>0)
{
if ($form_5_td_29_class!=$form_5_td_29_error_class) {$form_5_td_29_class=$form_5_td_29_error_class; $form_5_td_29_error=$form_5_td_29_error_spam; $form_5_error=$form_5_error_string;}
$form_5_spam += $form_5_td_29_spam;
}
$form_5_td_30_error_class='form_5_error';
$form_5_td_30_value=my_get_post('Address' ,true);
$form_5_body.='Address : '.my_get_post('Address')."\r\n";
$form_5_td_31_error_class='form_5_error';
$form_5_td_31_error_spam='Error: http: < > are not allowed!';
$form_5_td_31_value=my_get_post('Telephone' ,true);
$form_5_body.='Telephone : '.my_get_post('Telephone')."\r\n";
$form_5_td_31_spam=form_5_count_spam(my_get_post('Telephone'));
if ($form_5_td_31_spam>0)
{
if ($form_5_td_31_class!=$form_5_td_31_error_class) {$form_5_td_31_class=$form_5_td_31_error_class; $form_5_td_31_error=$form_5_td_31_error_spam; $form_5_error=$form_5_error_string;}
$form_5_spam += $form_5_td_31_spam;
}
$form_5_td_32_error_class='form_5_error';
$form_5_td_32_value=my_get_post('Comments' ,true);
$form_5_body.='Comments : '.my_get_post('Comments')."\r\n";
if (''!=trim(my_get_post('yourstreet'))) $form_5_spam += 10;
if (''!=trim(my_get_post('yourphone'))) $form_5_spam += 10;
if (''!=trim(my_get_post('phone'))) $form_5_spam += 10;
if (''!=trim(my_get_post('comment'))) $form_5_spam += 10;
if (''!=trim(my_get_post('youremail'))) $form_5_spam += 10;
if (''!=trim(my_get_post('youraddress'))) $form_5_spam += 10;
if (''==trim($form_5_error) && 0==$form_5_spam)
{
$receiver='dinki@hydeawayfarm.co.za';
$subject='Contact on dinki.hydeawayfarm.co.za';
$subject= substr($subject, 0, 255);
$subject=str_replace("\n", " ", $subject);
$subject=str_replace("\r", " ", $subject);
$body=str_replace("\n.", "\n..", $form_5_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://dinki.hydeawayfarm.co.za/thank-you.php';
if (!headers_sent()){
header('Location: '.$url); exit;
}else{
echo '';
echo ''; exit;
}
exit;
}
}
if (trim($form_5_error)) $form_5_error="
$form_5_error |
";
}
if ($form_5_spam >= 3) sleep(20);
if ($form_5_spam >= 3) $form_5_td_28_value='';
if ($form_5_spam >= 3) $form_5_td_29_value='';
if ($form_5_spam >= 3) $form_5_td_30_value='';
if ($form_5_spam >= 3) $form_5_td_31_value='';
if ($form_5_spam >= 3) $form_5_td_32_value='';
?>
Dinki se Wereld
|
Dinki se Wereld |
| |
|
|
|
Contact Me
Please tell me what you think about my website. If you provide me with your contact information, I can reach you in case I have any questions.
| |
|