File manager - Edit - /home/asiatechinc/public_html/asiatechinc-websites/starviewdesertcamp.com/mail.php
Back
<?php if ($_SERVER["REQUEST_METHOD"] == "POST") { if(ctype_space($_POST["name"])){ echo 'please provide any value'; } else if(ctype_space($_POST["phone"])) { echo 'please provide any value'; } else if (ctype_space($_POST["email"])){ echo 'please provide any value'; } else if (ctype_space($_POST["message"])){ echo 'please provide any value'; } else { $name = $_POST["name"]; /*$city = $_POST['city'];*/ $email = $_POST["email"]; $phone = $_POST["phone"]; $message = $_POST["message"]; $captcha = $_POST['g-recaptcha-response']; $secretKey ="6LfblbMqAAAAAJV6HTMfXZzrP_UL0gqEd9YKus5b"; $response = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=$secretKey&response=$captcha"); $responseData = json_decode($response); if ($responseData->success) { $EmailTo .= "starviewdesertcamp@gmail.com"; $Subject .= "Enquiry form Star view desert camp"; // prepare email body text $Fields .= "<table border='2px' style='border-collapse:collapse; width:100%;'>"; $Fields .= "<tr>"; $Fields .= "<td style='padding:5px;'>Name</td>"; $Fields .= "<td style='padding:5px;'>".$name."</td>"; $Fields .= "</tr>"; $Fields .= "<tr>"; $Fields.= "<td style='padding:5px;'>Email</td>"; $Fields .= "<td style='padding:5px;'>".$email."</td>"; $Fields .= "</tr>"; $Fields .= "<tr>"; $Fields.= "<td style='padding:5px;'>Phone</td>"; $Fields .= "<td style='padding:5px;'>".$phone."</td>"; $Fields .= "</tr>"; $Fields .= "<tr>"; $Fields .= "<td style='padding:5px;'>Message</td>"; $Fields .= "<td style='padding:5px;'>".$message."</td>"; $Fields .= "</tr>"; $Fields .= "</table>"; // // send email $headers = "MIME-Version: 1.0" . "\r\n"; $headers .= "Content-type:text/html;charset=UTF-8" . "\r\n"; $headers .= 'From: '.$email. "\r\n"; $success = mail($EmailTo, $Subject, $Fields, $headers); //header("Location:thank-you.php"); ?> <script> window.location="thank-you.php"; </script> <?php } else { header("Location: ".$_SERVER['HTTP_REFERER']."?error=captcha"); exit; } } } ?>
| ver. 1.4 |
Github
|
.
| PHP 7.4.33 | Generation time: 0.02 |
proxy
|
phpinfo
|
Settings