$to = 'support@dotbiz.com';
$cc = 'inordby@dotbiz.com';
$errors = array();
$form_sent = false;
if ($_POST) {
$name = trim(strip_tags($_POST['name']));
$email = trim(strip_tags($_POST['email']));
$comment = htmlspecialchars(trim(strip_tags($_POST['comment'])));
if (!$email || !is_valid_email($email)) {
$errors[] = 'ERROR: Invalid or missing e-mail address!';
}
if (!$comment) { $errors[] = 'ERROR: No comment text entered!'; }
if (strlen($comment) > 32768) {
$errors[] = 'ERROR: Comment is too long (32KB max.)!';
$comment = substr($comment,0,32768);
}
if (!$errors) {
$form_sent = mail($to,"DOTBIZ Contact Form from $name","COMMENTS FROM $name:\n$comment","CC: $cc\nFrom: $email");
if (!$form_sent) {
$errors[] = 'ERROR: Send error! Please use '.$to.' instead.';
} else {
$name = '';
$email = '';
$comment = '';
}
}
}
if ($form_sent || $errors) {
if ($errors) {
echo '
';
for ($i=0; $i'; }
echo "
\n";
} else {
?>
Thank you! Your comments have been sent.
}
}
?>
[ Home ]