$page_title = "Contact David Thomas Photography";
$meta_keywords = "contact, call, email, fax, visit, locate, location, gallery, studio, office";
$meta_description = "Contact dt-photo.com - David Thomas Photography";
include("../functions.php"); top(); title("Contact David Thomas Photography"); $timestamp = date(r);
if ($_REQUEST['loop'] == "submit" || $loop== "submit") {
//error-check
require_once('recaptchalib.php');
$privatekey = "6LfvLgAAAAAAAMPJFohovcudG6cGSUkRAOTgJ5gL";
$resp = recaptcha_check_answer ($privatekey,$_SERVER["REMOTE_ADDR"],$_REQUEST["recaptcha_challenge_field"],$_REQUEST["recaptcha_response_field"]);
$red_err = "**";
$error = "0";
//if (empty($regarding)) {$error = $error + 1; $regarding_error = $red_err; }
if (empty($_REQUEST['name'])) {$error = $error + 1; $name_error = $red_err; }
if (empty($_REQUEST['email_address'])) {$error = $error + 1; $email_address_error = $red_err; }
if (!eregi("^[a-z0-9\._-]+@+[a-z0-9\._-]+\.+[a-z]{2,6}$", $_REQUEST['email_address'])) { $error = $error + 1; $email_address_error = $red_err; }
if (empty($_REQUEST['phone'])) {$error = $error + 1; $phone_error = $red_err; }
//if (empty($respond)) {$error = $error + 1; $respond_error = $red_err; }
if (empty($_REQUEST['event_date'])) {$error = $error + 1; $event_date_error = $red_err; }
//if (empty($event_time)) {$error = $error + 1; $event_time_error = $red_err; }
if (empty($_REQUEST['event_location'])) {$error = $error + 1; $event_location_error = $red_err; }
if (empty($_REQUEST['hours_needed'])) {$error = $error + 1; $hours_needed_error = $red_err; }
//if (empty($wedding_package)) {$error = $error + 1; $wedding_package_error = $red_err; }
//if (empty($comments)) {$error = $error + 1; $comments_error = $red_err; }
//if (empty($esubscribe)) {$error = $error + 1; $esubscribe_error = $red_err; }
if (!$resp->is_valid) {$error = $error + 1; $recaptcha_error = $red_err; }
if ($error == "0") { $loop = "post"; } else { echo "You have $error fields which need to be corrected.
Please fix them, then submit this form again. back";
$loop = "";
}
if ($_REQUEST['loop'] == "post" || $loop== "post") {
$regarding = $_REQUEST['regarding'];
if ($regarding == "wedding") { $email = "weddings@dt-photo.com"; }
if ($regarding == "portrait") { $email = "portrait@dt-photo.com"; }
if ($regarding == "quote") { $email = "quotes@dt-photo.com"; }
if ($regarding == "other") { $email = "other@dt-photo.com"; }
if ($regarding == "web_site") { $email = "webmaster@dt-photo.com"; }
if (empty($email)) { $email = "dt@dt-photo.com"; }
//compile data
$customer_info = $_REQUEST['name']." ".$_REQUEST['phone']." ".$_REQUEST['respond']." ".$_REQUEST['event_date']." ".$_REQUEST['event_type']." ".$_REQUEST['event_time']." ".$_REQUEST['hours_needed']."-hrs".$_REQUEST['event_location']." ".$_REQUEST['comments'];
$customer_info = stripslashes($customer_info);
//$customer_info1 = substr($customer_info,0,160);
//if (strlen($customer_info) >= 170) { $customer_info2 = substr($customer_info,160,160); }
//if (strlen($customer_info) >= 330) { $customer_info3 = substr($customer_info,320,160); }
//if (strlen($customer_info) >= 490) { $customer_info4 = substr($customer_info,480,160); }
//if (strlen($customer_info) >= 420) { $customer_info5 = substr($customer_info,640,160); }
//text message to cell - chop at 160 & send second msg
$headers .= "From: ".$_REQUEST['name']." <".$_REQUEST['email_address'].">\n"; $headers .= "X-Sender: <".$_REQUEST['email_address'].">\n"; $headers .= "X-Mailer: PHP\n";
// mailer$headers .= "Return-Path: <$email_address>\n";
// mail to cellmail("9097327427@vtext.com","$name","$customer_info1","$headers");
//if (!empty($customer_info2)) { mail("9097327427@vtext.com","$name","$customer_info2","$headers"); }
//if (!empty($customer_info3)) { mail("9097327427@vtext.com","$name","$customer_info3","$headers"); }
//if (!empty($customer_info4)) { mail("9097327427@vtext.com","$name","$customer_info4","$headers"); }
//if (!empty($customer_info5)) { mail("9097327427@vtext.com","$name","$customer_info5 -David Thomas Photography - Online Form - Contact$name has submitted the following for your attention:
-----------------------------------------------------------
Name: $name
Phone: $phone
E-mail: $email_address
Respond via: $respond
Event Date: $event_date
Event Type: $regarding
Event Time: $event_time
Number of hours needed: $hours_needed
Event Location: $event_location
Comments: ".stripslashes($comments)."
Esubscribe: $esubscribe
-----------------------------------------------------------
Thank You,
David Thomas Photography