File manager - Edit - /home/asiatechinc/public_html/asiatechinc-websites/dtrjunglehideaways.com/booking-from-mail.php
Back
<?php // Collect form data $resident_status = $_POST['resident_status']; $name = $_POST['name']; $phone = $_POST['phone']; $email = $_POST['email']; $check_in_date = $_POST['check_in_date']; $check_out_date = $_POST['check_out_date']; $rooms_required = $_POST['rooms_required']; $total_adults = $_POST['total_adults']; $total_children_upto_5 = $_POST['total_children_upto_5']; $children_5_to_10 = $_POST['children_5_to_10']; $children_10_to_18 = $_POST['children_10_to_18']; $safari_ride = $_POST['safari_ride']; $pick_up_service = $_POST['pick_up_service']; // Construct the email content $formcontent = "Booking Form Details:\n\n"; $formcontent .= "Resident Status: " . ($resident_status == 'indian' ? 'Indian' : 'Foreign Resident') . "\n"; $formcontent .= "Full Name: $name\n"; $formcontent .= "Phone Number: $phone\n"; $formcontent .= "Email Address: $email\n"; $formcontent .= "Check-In Date: $check_in_date\n"; $formcontent .= "Check-Out Date: $check_out_date\n"; $formcontent .= "Rooms Required: $rooms_required\n"; $formcontent .= "Total Adults: $total_adults\n"; $formcontent .= "Total Children (up to 5 years): $total_children_upto_5\n"; $formcontent .= "Children (5 to 10 years): $children_5_to_10\n"; $formcontent .= "Children (10 to 18 years): $children_10_to_18\n"; $formcontent .= "Safari Ride: " . ($safari_ride == 'yes' ? 'Yes' : 'No') . "\n"; $formcontent .= "Pick-Up Service: " . ucfirst($pick_up_service) . "\n"; // Set the recipient, subject, and headers $recipient = "info@dtrjunglehideaways.com"; // Replace with your email address $subject = "DTR Jungle Hideaways Accommodation Booking Form"; $mailheader = "From: no-reply@dtrjunglehideaways.com \r\n"; // Replace with a suitable from email // Send the email using the mail() function if(mail($recipient, $subject, $formcontent, $mailheader)) { // Redirect to a thank-you page after successful email header("Location: thank-you.php"); exit(); // Important to stop further script execution } else { // Display an error message if the email fails to send echo "Error! Unable to send booking details. Please try again."; } ?>
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings