$errors = array(); if($HTTP_POST_VARS['action']){ if(!$HTTP_POST_VARS['first_name']){ $errors[] = "Please enter your first name."; } if(!$HTTP_POST_VARS['last_name']){ $errors[] = "Please enter your last name."; } if(!$HTTP_POST_VARS['company']){ $errors[] = "Please enter your company's name."; } if(!$HTTP_POST_VARS['business_phone']){ $errors[] = "Please enter your business phone number."; } if(!$HTTP_POST_VARS['email']){ $errors[] = "Please enter your email address."; } if(!$HTTP_POST_VARS['area_of_interest']){ $errors[] = "Please select areas of interest."; } if(count($errors) == 0){ $body = ''; foreach($HTTP_POST_VARS as $key => $value){ if(($key != 'area_of_interest')&&($key != 'action')&&($key != 'to')&&($value)){ $field = explode("_", $key); for($i = 0; $i < count($field); $i++){ $field[$i]{0} = strtoupper($field[$i]{0}); } $field = implode(" ", $field); $body .= "$field:\n ".nl2br(trim($value))."\n"; }elseif($key == 'area_of_interest'){ if(is_array($HTTP_POST_VARS['area_of_interest'])){ $body .= "Areas of interest:\n ".implode("\n ", $HTTP_POST_VARS['area_of_interest'])."\n"; }else{ $body .= "Areas of interest:\n".$HTTP_POST_VARS['area_of_interest']."\n"; } } } mail($HTTP_POST_VARS['to'], "Service Inquiry From Gorrells.com", $body, "From: info@gorrells.com"); header("Location: thankyou.php?serviceinquiry=true;"); exit; } } include("header.php"); if(!is_array($HTTP_POST_VARS['area_of_interest'])){ $HTTP_POST_VARS['area_of_interest'] = array(); } if(count($errors) > 0){ echo "