'; */ # Get feature info $body['featured_graphic'] = 'IMG'; $body['featured_text'] = '

Snail Mail

Washington DC/Northern Virginia
Meticulous
6359 Battlement Way
Alexandria, VA 22312

Email Us
Phone: 703.294.4832


'; ### # Standard e-mail validation regex function. Makes sure that an # e-mail address fits into a standard account@domain.tld format. # Returns true if it's valid, false if it's not. # Developed by Waldo Jaquith @ nancies.org ### function validate_email($email) { if (eregi("^[_\.0-9a-z-]+@([0-9a-z][-0-9a-z\.]+)\.([a-z]{2,3}$)", $email, $check)) { return true; } else { return false; } } function display_form($form_data) { $returned_data .= '
Name:
Email:
Subject:


'; return $returned_data; } # IF THE FORM HAS BEEN SUBMITTED, CHECK FOR ERRORS if ($_POST['submit']) { # Make sure no errors slip through. if (isset($errors)) unset($errors); if (empty($_POST["form_data"]["name"]) || (strlen($_POST["form_data"]["name"]) < 4)) $errors .= " Please enter your full name.\n"; if (empty($_POST["form_data"]["email"])) $errors .= " Please enter your e-mail address.\n"; elseif (!validate_email($_POST["form_data"]["email"])) $errors .= " Please enter a valid e-mail address.\n"; if (empty($_POST["form_data"]["subject"])) $errors .= " Please enter the subject of your message.\n"; if (empty($_POST["form_data"]["message"]) || (strlen($_POST["form_data"]["message"]) < 4)) $errors .= " Please enter your message.\n"; # If ERRORS, DISPLAY POPULATED FORM if (isset($errors)) { $body["featured_text"] .= '

Contact Form

'.nl2br($errors).'

' . display_form($_POST["form_data"]); # IF NO ERRORS, MAIL FORM } else { ### # Assemble the body of the message. ### $email_body = stripslashes($_POST["form_data"]["message"]); # Determine the recipients. $recipient_address = "info@meticulous.com"; # Format Headers. $email_subject = "[meticulous]: ".ucfirst($_POST["form_data"]["subject"]); $email_headers = "From: ".$_POST["form_data"]["name"]." <".$_POST["form_data"]["email"].">\n"; $email_headers .= "X-Originating-IP: ".$_SERVER['REMOTE_ADDR']."\n"; # Email Test mail($recipient_address, $email_subject, $email_body, $email_headers); # Send the mail to the user (if selected Cc box). $email_body .= "\n\n\n" . "---------------------------------------------------------\n" . "Thanks for contacting Meticulous Design Group!\n" . "---------------------------------------------------------\n\n"; mail($_POST["form_data"]["name"]." <".$_POST["form_data"]["email"].">", $email_subject, $email_body, $email_headers); $body["featured_text"] .= "

Contact Form

Thanks for contacting us!




"; } # DISPLAY THE FORM INITIALLY } else { $body["featured_text"] .= '

Contact Form

' . display_form(''); } # The bottom "portal" section $body['portal'] = get_portal($body['zone']); # Display the contents in the template provided echo display_template($body); ?>