session_start();
require_once "functions.inc";
require_once "db.php";
// Connecting, selecting database
$con = connect_db();
if($_REQUEST["form_action"] == 'submitted'){
include_once './securimage/securimage.php';
$securimage = new Securimage();
if ($securimage->check($_POST['captcha_code']) == false) {
$message = 'The Security Word was incorrect.';
}
else{
// looks like we got a good one
$email_to = "marketing@bakersbasinmarina.com,info@bakersbasinmarina.com";
$email_body = "You have an email from: ";
$email_body .= $_REQUEST['email'] . "
";
$email_body .= "Name: " . $_REQUEST['name'] . "
";
$email_body .= "Address: " . $_REQUEST['address'] . "
";
$email_body .= "City: " . $_REQUEST['city'] . "
";
$email_body .= "State: " . $_REQUEST['state'] ."
";
$email_body .= "Zip: " . $_REQUEST['zip'] ."
";
$email_body .= "Phone: " . $_REQUEST['areacode'] . "-" . $_REQUEST['prefix'] . "-" . $_REQUEST['phone'] ."
";
$email_body .= "Fax: " . $_REQUEST['fax_areacode'] . "-" . $_REQUEST['fax_prefix'] . "-" . $_REQUEST['fax_phone'] ."
";
// grab the checkboxes
if($_REQUEST['recreation'] == 'on' || $_REQUEST['hotels'] == 'on' || $_REQUEST['slips'] == 'on' || $_REQUEST['restaraunts'] == 'on') $email_body .= "Interested in:
";
if($_REQUEST['slips'] == 'on') $email_body .= " Boat Slips
";
if($_REQUEST['hotels'] == 'on') $email_body .= " Hotels Nearby
";
if($_REQUEST['restaraunts'] == 'on') $email_body .= " Restaraunts Nearby
";
if($_REQUEST['recreation'] == 'on') $email_body .= " Recreation
";
//if($_REQUEST[''] == 'on') $email_body .= "
";
//if($_REQUEST[''] == 'on') $email_body .= "
";
if(strlen($_REQUEST['message']) > 0){
$email_body .= "
Additional Comments
". $_REQUEST['message'];
}
if(strlen($_REQUEST['contact_method']) > 0){
$email_body .= "
Please Contact Me by
". $_REQUEST['contact_method'];
}
if(strlen($_REQUEST['contact_times']) > 0){
$email_body .= "
Contact Times
". $_REQUEST['contact_times'];
}
if(strlen($_REQUEST['name']) > 0 && strlen($_REQUEST['email']) > 0){
//$cust_email=mail("$email_to","Contact from Bakers Marina on the Bay Website","$email_body","From:".$_REQUEST['email']."\nContent-type:text/html");
}
$sql = "insert into email_list (email, name) values ('".$_REQUEST['email']."','".$_REQUEST['name']."')";
//$result = @mysqli_query($con, $sql);
$form_submit_ok = TRUE;
}
}
$page_name = 'contact';
?>