define('MENU_HIGHLIGHT', 'CONTACTUS'); define('REQ_FIELD', '*'); require_once('inc/global.php'); $msg = (isset($_GET['msg']))? $_GET['msg']:''; list($meta_title, $meta_description, $meta_keywords, $header_title) = get_meta(); if(count($_POST)) { extract($_POST); $dec_type = ''; if(isset($decorated_type) && $decorated_type) $dec_type = implode(', ', $decorated_type); $arr_vals["FULL_NAME"] = $first_name.' '.$last_name; $arr_vals["ADDRESS"] = $street_address.', '.$city.', '.$state; $arr_vals["EMAIL"] = $email; $arr_vals["PHONE"] = $phone; $arr_vals["RESIDENCE_TYPE"] = $residence_type; $arr_vals["MATERIAL_TYPE"] = $material_type; $arr_vals['DECORATED_TYPE'] = $dec_type; $arr_vals["MESSAGE"] = $message; $arr_vals["WEBSITE_NAME"] = 'Vibrant Lighting'; $arr_vals["WEB_SERVER"] = 'http://www.vibrantlighting.com'; $dmessage = $message; //Prepare the html $message = prepare_mail('inc/emails/contact_email.txt', $arr_vals); $subject = 'New Contact Request On VibrantLighting.com'; $to = 'scheduling@vibrantlighting.com'; //$to = 'genius.munu@gmail.com'; $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; $headers .= 'From: Vibrant Lighting ' . "\r\n"; mail($to, $subject, $message, $headers); //Now insert into the database $query = "INSERT INTO customers SET"; $query.= " first_name = '".mysql_real_escape_string($first_name)."'"; $query.= ", last_name = '".mysql_real_escape_string($last_name)."'"; $query.= ", lead_source = 'Contact'"; $query.= ", phone = '$phone'"; $query.= ", email = '$email'"; $query.= ", street_address = '".mysql_real_escape_string($street_address)."'"; $query.= ", city = '$city'"; $query.= ", state = '$state'"; $query.= ", residence_type = '$residence_type'"; $query.= ", material_type = '$material_type'"; $query.= ", decorated_type = '$dec_type'"; $query.= ", comments = '".mysql_real_escape_string($dmessage)."'"; $query.= ", date_added = NOW()"; mysql_query($query, $conn); header('Location: contact-us.php?msg=Thank you for your email. Someone will be getting back to you soon.'); exit(0); } ?> Request A Free Estimate - Contact Us