"; $subject = "Thank you $formData[contact_fname] $formData[contact_lname] for contacting us!"; $message_body .= " - We have received your request and will be contacting you soon.
"; if(isset($_POST[contact_join_mailing_list])) { $message_body .= "
- This message is to confirm that you have ". "joined the Dan Merkel Mailing List. If this message ". "was found in your junk mail folder please add us to ". "your safe senders list.
". " - To remove yourself from the list simply reply to ". "this email with \"REMOVE ME FROM YOUR LIST\" in the subject.
"; } $success2 = mail( $formData[contact_email], $subject, $message_body, "To: $formData[contact_email]\n" . "From: $from\n" . "MIME-Version: 1.0\n" . "Content-type: text/html; charset=iso-8859-1"); if($success2) { //print "An email copy of your order has been sent to: $trimed_email.
"; }else{ print "There was a problem sending your confirmation email. To Confirm your order please call 1-805-698-3626.
"; } } function send_contact($formData) { //****************** send customer copy $from = "Dan Merkel Media "; $subject = "$formData[contact_fname] $formData[contact_lname] is trying to contact us!"; $message_body .= "Contact Information:
".date("F j, Y, g:i a")." $formData[contact_foundus]
$formData[contact_email]
$formData[contact_fname]
$formData[contact_lname]
$formData[contact_company]
$formData[contact_home_phone]
$formData[contact_other_phone]
$formData[contact_address1]
$formData[contact_address2]
$formData[contact_city]
$formData[contact_state]
$formData[contact_zip]
$formData[contact_country]
$formData[contact_interest]
"; $success2 = mail( "danmerkel@panoramicimages.com", $subject, $message_body, "To: danmerkel@panoramicimages.com\n" . "From: $from\n" . "MIME-Version: 1.0\n" . "Content-type: text/html; charset=iso-8859-1"); if($success2) { //print "An email copy of your order has been sent to: $trimed_email.
"; }else{ print "There was a problem sending your confirmation email. To Confirm your order please call 1-805-698-3626.
"; } } function getData() { $formData = array(); $formData[contact_foundus] = $_POST["contact_foundus"]; $formData[contact_email] = $_POST["contact_email"]; $formData[contact_fname] = $_POST["contact_fname"]; $formData[contact_lname] = $_POST["contact_lname"]; $formData[contact_company] = $_POST["contact_company"]; $formData[contact_home_phone] = $_POST["contact_home_phone"]; $formData[contact_other_phone] = $_POST["contact_other_phone"]; $formData[contact_address1] = $_POST["contact_address1"]; $formData[contact_address2] = $_POST["contact_address2"]; $formData[contact_city] = $_POST["contact_city"]; $formData[contact_state] = $_POST["contact_state"]; $formData[contact_zip] = $_POST["contact_zip"]; $formData[contact_country] = $_POST["contact_country"]; $formData[contact_interest] = $_POST["contact_interest"]; array_walk($formData, 'safe_value'); // return the validated form data return $formData; } function safe_value(&$value) { // take care of magic quotes $value = stripslashes($value); // remove html $value = strip_tags($value); // remove white space $value = trim($value); // make special characters harmless $value = htmlspecialchars($value, ENT_QUOTES); // make safe for mysql $value = mysql_escape_string($value); } // check the required fields and flag errors function check_input($formData) { $valid = 1; // survey_foundus if( ($formData[contact_foundus] != "0") //&& ereg('[^A-Za-z0-9]', $formData[survey_foundus]) && (strlen($formData[contact_foundus]) <= 7)) { // do nothing }else{ $valid = 0; // flag the error $formData[contact_foundus] = '0'; $formData[contact_foundus_error] = 1; $formData[contact_foundus_error_text] = "Please tell us how you found us."; } // email address must be of a valid format if(eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$", $formData[contact_email])) { // do nothing }else{ $valid = 0; // flag the error $formData[email_error] = 1; $formData[email_error_text] = "Please enter a valid email address."; } // first name must be more than 2 chars and less than or = 50 $formData[contact_fname] = preg_replace('/[^a-z0-9 .]/i', '', $formData[contact_fname]); if( strlen($formData[contact_fname]) >= 2 && strlen($formData[contact_fname]) <= 50) {}else{ $valid = 0; // flag the error $formData[fname_error] = 1; $formData[fname_error_text] = "Your first name must be between 2 and 50 characters."; } // last name must be more than 2 chars and less than or = 50 $formData[contact_lname] = preg_replace('/[^a-z0-9 .]/i', '', $formData[contact_lname]); if( strlen($formData[contact_lname]) >= 2 && strlen($formData[contact_lname]) <= 50) {}else{ $valid = 0; // flag the error $formData[lname_error] = 1; $formData[lname_error_text] = "Your last name must be between 2 and 50 characters."; } // company must be less than 100 chars $formData[contact_company] = preg_replace('/[^a-z0-9 &.]/i', '', $formData[contact_company]); if(strlen($formData[contact_company]) <= 100) {}else{ $valid = 0; // flag the error $formData[company_error] = 1; $formData[company_error_text] = "Company Name can not be more than 100 characters"; } return $valid; } function insert_data($formData) { $conn = db_connect(); $mysql = "insert into `danielmerkl`.`mailing_list` (id, date_added, foundus, email, home_phone, other_phone, fname, lname, company, line1, line2, city, state, state_other, zip, country, interest, ip_address) values ( null, now(), '$formData[contact_foundus]', '$formData[contact_email]', '$formData[contact_home_phone]', '$formData[contact_other_phone]', '$formData[contact_fname]', '$formData[contact_lname]', '$formData[contact_company]', '$formData[contact_line1]', '$formData[contact_line2]', '$formData[contact_city]', '$formData[contact_state]', '$formData[contact_state_other]', '$formData[contact_zip]', '$formData[contact_country]', '$formData[contact_interest]', '".getenv ("REMOTE_ADDR")."' )"; $result = mysql_query($mysql, $conn); } function print_thanks($formData) { print "





Thank you for contacting us "; if(isset($_POST[contact_join_mailing_list])) { print "and thanks for joining our mailing list.

"; } print "
If you do not receive a message from us confirming your request check your junk mail filter to make sure we are on your safe senders list. If you are not sure how to do this contact your Internet Service Provider.




"; } function strip_slashes(&$value) { $value = stripslashes($value); } function print_form($formData) { array_walk($formData, 'strip_slashes'); print "
Send an email to danmerkel@panoramicimages.com or fill out the form below and the appropriate representative will contact you. Additionally, we can be reached at: 800-543-5250 Your personal information will only be used by Dan Merkel Media and not given out to any third parties. If you wish check the box below to join our mailing list. You will be able to unsubscribe at any time by using the link at the bottom of our newsletters.
How did you find us? ".survey_foundus_options($formData[contact_foundus])."
Email:
First Name:
Last Name:
Optional Information
Home #:
Other #:
Company:
Address:
 
City:
State:
Zip / Postal Code:
Country:
Interests
Check the box to join our mailing list.

"; } function survey_foundus_options($adID) { //connect to database $conn = db_connect(); $mysql = "SELECT * FROM retail_source_keys"; $adcosts_res = mysql_query($mysql, $conn); $retstr = "