"; } if(empty($_REQUEST['lname'])) { $errMsg .= "Last Name can not be blank.
"; } $name = $_REQUEST['lname'] ." ".$_REQUEST['lname']; if(empty($_REQUEST['email'])) { $errMsg .= "Email can not be blank.
"; } elseif(!eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,3})$", $_REQUEST['email'])) { $errMsg .= "Email should be in proper format.
"; } if(empty($_REQUEST['phonehome'])) { $errMsg .= "Phone number can not be blank.
"; } elseif (!is_numeric($_POST['phonehome'])) { $errMsg .= "Phone number should be numeric.
"; } // $privatekey = "6Lfugr0SAAAAAPfpnl-MuAh7M82Krijsv7UpHTsG"; // $resp = recaptcha_check_answer ($privatekey, // $_SERVER["REMOTE_ADDR"], $_POST["ctlSecurityCode"], $_POST["recaptcha_response_field"]); if ($_SESSION['security_code']!= $_REQUEST['ctlSecurityCode']) { $errMsg .= "Incorrect Captcha code.
"; } else { $fname = $_REQUEST['fname']; $lname = $_REQUEST['lname']; $address = $_REQUEST['address']; $email = $_REQUEST['email']; $city = $_REQUEST['city']; $phonehome = $_REQUEST['phonehome']; /* if($phonehome!='') { $phonehome = formatPhone($phonehome); } */ $phonework = $_REQUEST['phonework']; /*if($phonework!='') { $phonework = formatPhone($phonework); } */ $timetocall = $_REQUEST['timetocall']; $timetocall = $_REQUEST['timetocall']; $timetocall2 = $_REQUEST['timetocall2']; $timezone = $_REQUEST['timezone']; $wc_category = $_REQUEST['wc_category']; $term_month = $_REQUEST['term_month']; $dob_day = $_REQUEST['dob_day']; $dob_year = $_REQUEST['dob_year']; $message = $_REQUEST['message']; $state = $_REQUEST['state']; $zip= $_REQUEST['zip']; $today = date("m.d.y, g:i a"); $ip=$_SERVER['REMOTE_ADDR']; $subject ="West Coast Insurance // ".ucfirst($name); if($wc_category!='') { $subject .="- Request ".$wc_category." Information"; } $messagesshow="
| First Name : | $fname | ||||||||
| Last Name : | $lname | ||||||||
| E-mail : | |||||||||
| Address : | $address | ||||||||
| City : | $city | ||||||||
| State : | $state | ||||||||
| Zip : | $zip | ||||||||
| Home Phone: | $phonehome | ||||||||
| Work Phone : | $phonework | ||||||||
| Best Time to Call: | $timetocall $timetocall2 | ||||||||
| Time Zone: | $timezone | ||||||||
| Dob month : | $term_month | ||||||||
| Dob day: | $dob_day | ||||||||
| Dob year: | $dob_year | ||||||||
| Message: $message | WC Category: | $wc_category | Form submited $today from $ip | ||||||
" ; $to = 'jason@westcoastri.com' . ', '; // note the comma $to .= 'eliel@westcoastri.com'; // subject // To send HTML mail, the Content-type header must be set $headers = 'MIME-Version: 1.0' . "\r\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n"; // Additional headers $headers .= 'From:' . "\r\n"; mail($to, $subject, $messagesshow, $headers); echo "
"; $errMsg .= "Thanks for your interest with us! Our representative will contact you soon.
"; } } ?>
|
|