File manager - Edit - /home/asiatechinc/public_html/asiatech-websites/cocogardengoa.com/mail.php.tar
Back
home/asiatechinc/public_html/asiatech-websites/cocogardengoa.com/mail.php 0000750 00000003201 15161300531 0022645 0 ustar 00 <?php if ($_SERVER["REQUEST_METHOD"] == "POST") { $name = $_POST["name"]; $email = $_POST["email"]; $phone = $_POST["phone"]; $message = $_POST["message"]; $captcha = $_POST['g-recaptcha-response']; $secretKey ="6LddK70qAAAAAJT0NCsVNaj8HDLniADnTaGzt7hv"; $response = file_get_contents("https://www.google.com/recaptcha/api/siteverify?secret=$secretKey&response=$captcha"); $responseData = json_decode($response); if ($responseData->success) { $EmailTo = "fernandescriston@yahoo.in"; $Subject = "Enquiry From Coco Garden"; // 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"); } else { header("Location: ".$_SERVER['HTTP_REFERER']."?error=captcha"); exit; } } ?> home/asiatechinc/public_html/asiatechinc-websites/minikins.in/mail.php 0000750 00000007043 15161341373 0022236 0 ustar 00 <?php // Include reCAPTCHA secret key $secretKey = "6LeGvscqAAAAAJ1tASGMW0_RCkhACzPbHI6x_iCo"; // Collect form data $name = $_POST["name"] ?? ''; $email = $_POST["email"] ?? ''; $phone = $_POST["phone"] ?? ''; $message = $_POST["message"] ?? ''; $recaptchaResponse = $_POST['g-recaptcha-response'] ?? ''; // Verify reCAPTCHA response $verifyUrl = "https://www.google.com/recaptcha/api/siteverify"; $recaptchaData = [ 'secret' => $secretKey, 'response' => $recaptchaResponse, 'remoteip' => $_SERVER['REMOTE_ADDR'] ]; $options = [ 'http' => [ 'method' => 'POST', 'header' => 'Content-type: application/x-www-form-urlencoded', 'content' => http_build_query($recaptchaData) ] ]; $context = stream_context_create($options); $response = file_get_contents($verifyUrl, false, $context); $responseKeys = json_decode($response, true); // If reCAPTCHA validation fails, show an error message if (!$responseKeys["success"]) { echo "<!DOCTYPE html> <html lang='en'> <head> <meta charset='UTF-8'> <meta name='viewport' content='width=device-width, initial-scale=1.0'> <title>reCAPTCHA Error</title> <style> body { font-family: Arial, sans-serif; background-color: #f8f9fa; margin: 0; padding: 0; display: flex; align-items: center; justify-content: center; height: 100vh; color: #333; } .container { text-align: center; padding: 20px; background: white; border: 1px solid #ddd; box-shadow: 0 4px 8px rgba(0,0,0,0.1); border-radius: 5px; max-width: 400px; } .container h1 { color: #e63946; } .container p { margin: 15px 0; } .btn { display: inline-block; text-decoration: none; color: white; background-color: #007bff; padding: 10px 20px; border-radius: 4px; margin-top: 20px; } .btn:hover { background-color: #0056b3; } </style> </head> <body> <div class='container'> <h1>Error</h1> <p>There was a problem validating the reCAPTCHA. Please try again.</p> <a class='btn' href='javascript:history.back()'>Go Back</a> </div> </body> </html>"; exit; } // Proceed with email sending if reCAPTCHA validation is successful $EmailTo ="minikinsresort@gmail.com"; $Subject ="Enquiry from Minikins"; // Prepare email body text $Fields = "<table border='2px' style='border-collapse:collapse; width:100%;'>"; $Fields .= "<tr><td style='padding:5px;'>Name</td><td style='padding:5px;'>".$name."</td></tr>"; $Fields .= "<tr><td style='padding:5px;'>Email</td><td style='padding:5px;'>".$email."</td></tr>"; $Fields .= "<tr><td style='padding:5px;'>Phone</td><td style='padding:5px;'>".$phone."</td></tr>"; $Fields .= "<tr><td style='padding:5px;'>Message</td><td style='padding:5px;'>".$message."</td></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); // Redirect to thank-you page header("Location: thank-you.php"); ?> home/asiatechinc/public_html/asiatech-websites/sv-inns.com/mail.php 0000750 00000005150 15161342634 0021466 0 ustar 00 <?php function reCaptcha($recaptcha){ $secret = "6LcQnskqAAAAAMAm6OVRrDvvIZXP-gc5K2sVlMZx"; $ip = $_SERVER['REMOTE_ADDR']; $postvars = array("secret"=>$secret, "response"=>$recaptcha, "remoteip"=>$ip); $url = "https://www.google.com/recaptcha/api/siteverify"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_TIMEOUT, 10); curl_setopt($ch, CURLOPT_POSTFIELDS, $postvars); $data = curl_exec($ch); curl_close($ch); return json_decode($data, true); } // 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); $lastname = strip_tags(trim($_POST["lastname"])); $lastname= str_replace(array("\r","\n"),array(" "," "),$lastname); $email = filter_var(trim($_POST["email"]), FILTER_SANITIZE_EMAIL); $contact = strip_tags(trim($_POST["contact"])); $message = strip_tags(trim($_POST["message"])); if ( empty($name) OR !filter_var($email, FILTER_VALIDATE_EMAIL) 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"; $message1="<table><tr><td>Name</td><td>".$name."</td></tr> <tr><td>Lastname</td><td>".$lastname."</td></tr> <tr><td>Email</td><td>".$email."</td></tr> <tr><td>Contact</td><td>". $contact."</td></tr> <tr><td>Message</td><td>". $message."</td></tr> </table>"; $recipient = "reservations@sv-inns.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,$message1, $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."; } ?>