The phone number is a good idea as a spam bot probably won't fill that in correct, especially if we validate it. :)
This method will accept a 10 digit phone number with spaces, dashes, or neither.
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Sendemail Script</title>
</head>
<body>
<!-- Reminder: Add the link for the 'next page' (at the bottom) -->
<!-- Reminder: Change 'YourEmail' to Your real email -->
<?php
$ip = $_POST['ip'];
$httpref = $_POST['httpref'];
$httpagent = $_POST['httpagent'];
$visitormail = $_POST['email'];
$comments = $_POST['comments'];
$case_description = $_POST['case_description'];
$phone = $_POST['phone'];
$street = $_POST['address'];
$yourname = $_POST['name'];
$todayis = date("l, F j, Y, g:i a") ;
$subject = $attn;
$notes = stripcslashes($notes);
$message = " $todayis [EST] \n
From: $yourname ($visitormail)\n
Phone Number: $phone \n
Address: $street \n
Comments: $comments \n
Case Description: $case_description \n
Additional Info : IP = $ip \n
Browser Info: $httpagent \n
Referral : $httpref \n
";
$from = "From: $visitormail\r\n";
if (!preg_match('/^\d{3}[\s-]?\d{3}[\s-]?\d{4}$/', $phone)) {
echo 'The phone number you provided was invalid.';
} else {
mail("jcernamonroe@yahoo.com", "Contact Info from Exclusively Criminal Deffense", $message, $from);
?>
<p align="center">
<SCRIPT LANGUAGE="JavaScript">
window.location="../success.html";
</script>
<?php } ?>
</body>
</html>