Thank You!

Your submission has been received.

'; exit; } // 2. Anti-Spam: Math verification challenge (3 + 4 = 7) $verify = isset($_POST['verify_answer']) ? trim($_POST['verify_answer']) : ''; if ($verify !== '7') { echo ' Verification Failed

Security Check Failed

Incorrect answer to the math verification question. Please go back and try again.

← Go Back
'; exit; } // 3. Sanitize form values $name = isset($_POST['name']) ? strip_tags(trim($_POST['name'])) : ''; $email = isset($_POST['email']) ? filter_var(trim($_POST['email']), FILTER_SANITIZE_EMAIL) : ''; $city = isset($_POST['city']) ? strip_tags(trim($_POST['city'])) : ''; $phone = isset($_POST['phone']) ? strip_tags(trim($_POST['phone'])) : ''; $raw_remarks = isset($_POST['remarks']) ? trim($_POST['remarks']) : ''; $remarks = !empty($raw_remarks) ? nl2br(htmlspecialchars($raw_remarks)) : 'None provided'; $remarks_plain = !empty($raw_remarks) ? $raw_remarks : 'None provided'; // Discard empty submissions if (empty($name) || empty($email)) { header("Location: contactform.html"); exit; } // 4. Business recipient configuration (Set to your test email) $to = "jeff.brooky@gmail.com"; $subject = "New Consultation Inquiry: " . $name; // 5. Construct MIME boundary for clean plain-text + HTML delivery $boundary = "----=_Part_" . md5(time()); // Plain text body with explicit double line breaks to prevent text squashing $plain_body = "Burlingame Kitchens & Bath - New Consultation Request\n\n"; $plain_body .= "Name: " . $name . "\n\n"; $plain_body .= "Email: " . $email . "\n\n"; $plain_body .= "City: " . $city . "\n\n"; $plain_body .= "Phone: " . $phone . "\n\n"; $plain_body .= "Preferred Day/Time & Remarks:\n"; $plain_body .= $remarks_plain . "\n\n"; $plain_body .= "--------------------------------------------------\n"; $plain_body .= "Submitted on: " . date("r") . "\n"; // HTML body (styled card layout) $html_body = '

Burlingame Kitchens & Bath

New Consultation Request

Name:' . htmlspecialchars($name) . '
Email:' . htmlspecialchars($email) . '
City:' . htmlspecialchars($city) . '
Phone:' . htmlspecialchars($phone) . '

Preferred Day / Time & Remarks:

' . $remarks . '
Reply to Client
'; // Construct MIME multipart message $message = "--" . $boundary . "\r\n"; $message .= "Content-Type: text/plain; charset=UTF-8\r\n"; $message .= "Content-Transfer-Encoding: 7bit\r\n\r\n"; $message .= $plain_body . "\r\n\r\n"; $message .= "--" . $boundary . "\r\n"; $message .= "Content-Type: text/html; charset=UTF-8\r\n"; $message .= "Content-Transfer-Encoding: 7bit\r\n\r\n"; $message .= $html_body . "\r\n\r\n"; $message .= "--" . $boundary . "--"; // Headers $headers = array(); $headers[] = "MIME-Version: 1.0"; $headers[] = "Content-Type: multipart/alternative; boundary=\"" . $boundary . "\""; $headers[] = "From: Burlingame Kitchens & Bath "; if (!empty($email)) { $headers[] = "Reply-To: " . $email; } $headers[] = "X-Mailer: PHP/" . phpversion(); $header_string = implode("\r\n", $headers); // 6. Send Email and Confirmation Page if (mail($to, $subject, $message, $header_string)) { echo ' Thank You

Thank You, ' . htmlspecialchars($name) . '!

Your consultation request has been submitted successfully.

← Return to Website
'; } else { echo "

Sorry, there was an issue sending your message. Please contact us directly at jeff.brooky@gmail.com.

"; } } else { header("Location: contactform.html"); exit; } ?>