File manager - Edit - /home/asiatechinc/public_html/asiatech-websites/skyinnbungalow.com/includes/mail.php
Back
<?php // Only process POST reqeusts. if (isset($_POST)) { // Get the form fields and remove whitespace. $name = strip_tags(trim($_POST["name"])); $name = str_replace(array("\r","\n"),array(" "," "),$name); $email = filter_var(trim($_POST["email"]), FILTER_SANITIZE_EMAIL); $contact = strip_tags(trim($_POST["contact"])); $Arrival = strip_tags(trim($_POST["date"])); $Departure = strip_tags(trim($_POST["date1"])); $Adults = strip_tags(trim($_POST["num"])); $child = strip_tags(trim($_POST["child"])); if ( empty($name) OR !filter_var($email, FILTER_VALIDATE_EMAIL) OR $Arrival =='' OR $Departure ==''OR $Adults ==''OR $child =='' OR $contact =='') { echo "Oops! There was a problem with your submission. Please complete the form and try again."; exit; } $subject="Enquiry Mail"; // Set the email subject. $subject = " $subject"; $message="<table><tr><td>Name</td><td>".$name."</td></tr> <tr><td>Email</td><td>".$email."</td></tr> <tr><td>Contact</td><td>". $contact."</td></tr> <tr><td>Check In</td><td>".date("d-m-Y",strtotime($Arrival))."</td></tr> <tr><td>Check Out</td><td>".date("d-m-Y",strtotime($Departure))."</td></tr> <tr><td>Adult</td><td>".$Adults."</td></tr> <tr><td>Child</td><td>". $child."</td></tr> </table>"; $recipient = "skyinnbungalow@gmail.com"; $email_content .= "Name: $name\n"; $email_content .= "Email: $email\n"; $email_content .= "Message:\n$message\n\n"; // Build the email headers. $email_headers = "From: $name <$email>"; $email_headers .= "Reply-To: $email \r\n"; $email_headers .= "Content-Type: text/html; charset=utf-8"; // Send the email. if (mail($recipient, $subject,$email_content, $email_headers)) { // Set a 200 (okay) response code. echo "Thank You! Your message has been sent."; } else { // Set a 500 (internal server error) response code. echo "Oops! Something went wrong and we couldn't send your message."; } } else { // Not a POST request, set a 403 (forbidden) response code. echo "There was a problem with your submission, please try again."; } ?>
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings