alert('Please complete the form and try again.');window.location='index.html';"; exit; } // Set the recipient email address. // FIXME: Update this to your desired email address. $recipient = "thakurranjitsingh092@gmail.com"; // Set the email subject. $subject = "New Email For Booking For One Way"; // Build the email content. $email_content = "Pickup Location: $pickup\n"; $email_content .= "Drop Location: $drop\n"; $email_content .= "Phone Number: $phone\n"; $email_content .= "Date: $date\n"; $email_content .= "Pickup Time: $time\n"; // Build the email headers. $email_headers = "From: $name "; // Send the email. if (mail($recipient, $subject, $email_content, $email_headers)) { // Set a 200 (okay) response code. http_response_code(200); echo (""); } else { // Set a 500 (internal server error) response code. http_response_code(500); echo ""; } } else if(isset($_POST['round_way'])) { // Get the form fields and remove whitespace. $pickup = trim($_POST["pickup"]); $drop = trim($_POST["drop"]); $date = trim($_POST["date"]); $time = trim($_POST["time"]); $time = trim($_POST["phone"]); // Check that data was sent to the mailer. if (empty($pickup) || empty($drop) || empty($date) || empty($time)) { // Set a 400 (bad request) response code and exit. http_response_code(400); echo ""; exit; } // Set the recipient email address. // FIXME: Update this to your desired email address. $recipient = "thakurranjitsingh092@gmail.com"; // Set the email subject. $subject = "New Email For Booking For Round Way"; // Build the email content. $email_content = "Pickup Location: $pickup\n"; $email_content .= "Drop Location: $drop\n"; $email_content .= "Phone Number: $phone\n"; $email_content .= "Date: $date\n"; $email_content .= "Pickup Time: $time\n"; // Build the email headers. $email_headers = "From: $name "; // Send the email. if (mail($recipient, $subject, $email_content, $email_headers)) { // Set a 200 (okay) response code. http_response_code(200); echo (""); } else { // Set a 500 (internal server error) response code. http_response_code(500); echo ""; } } ?>