Thank you for your comments. Your information has been mailed.
} else { ?> } ?>$mode = $_GET['mode']; // include form-processing functions require_once("includes/form_functions.php"); require_once("includes/functions.php"); // begin form processing if(isset($mode)) { $name = $_POST['name']; $address = $_POST['address']; $city = $_POST['city']; $state = $_POST['state']; $zip = $_POST['zip']; $phone = $_POST['phone']; $email = $_POST['email']; $hours = $_POST['hours']; $time = $_POST['time']; $comments = $_POST['comments']; $interest = $_POST['interest']; } else { $error = ""; $name = ""; $address = ""; $city = ""; $state = ""; $zip = ""; $phone = ""; $email = ""; $hours = ""; $time = ""; $comments = ""; $interest = ""; } if (isset($mode)) { $error = ""; // start validation routines while($error == "") { if(strlen($name) < 5) { $error = "Please enter your full name."; break; } if(strlen($address) < 5) { $error = "Please enter your address."; break; } if(strlen($city) < 5) { $error = "Please enter your city."; break; } if(strlen($state) < 2) { $error = "Please enter your state."; break; } if(strlen($zip) < 5) { $error = "Please enter your zip."; break; } if(strlen($phone) < 10) { $error = "Please enter your phone number, including area code."; break; } if (!valid_phone($phone)) { $error = "Please enter a valid phone number."; break; } if(strlen($email) < 5) { $error = "Please enter your email address."; break; } if (!valid_email($email)) { $error = "Please enter a valid email address."; break; } break; } // end validation routines // form has been submitted: if there are no errors, set up email and send $toaddress = "spagnaremodeling@aol.com, 6037939637@vtext.com, jmspagna@aol.com"; $subject = "Contact Us Form Submission"; $fromaddress = $email; $mailbody = ""; $mailbody = $mailbody."The following information was submitted\n\n"; $mailbody = $mailbody."Name: ".$name."\n"; $mailbody = $mailbody."Address: ".$address."\n"; $mailbody = $mailbody."City: ".$city."\n"; $mailbody = $mailbody."State: ".$state."\n"; $mailbody = $mailbody."Zip: ".$zip."\n"; $mailbody = $mailbody."Phone Number: ".$phone."\n"; $mailbody = $mailbody."Email Address: ".$email."\n"; $mailbody = $mailbody."Contact Time: ".$hours." ".$time."\n"; $mailbody = $mailbody."Interest: ".$interest."\n"; $mailbody = $mailbody."\nComments:\n".$comments; $from = "From: ".$fromaddress."\n"; if($error == "") { mail($toaddress, $subject, $mailbody, $from); } } // end form processing ?>
Thank you for your comments. Your information has been mailed.
} else { ?> } ?>