|
Server IP : 86.38.243.193 / Your IP : 216.73.216.42 Web Server : LiteSpeed System : Linux in-mum-web1336.main-hosting.eu 4.18.0-553.34.1.lve.el8.x86_64 #1 SMP Thu Jan 9 16:30:32 UTC 2025 x86_64 User : u493057690 ( 493057690) PHP Version : 8.2.30 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : OFF | Python : ON Directory (0755) : /home/u493057690/domains/iasfindia.com/../agradaytourpackages.com/public_html/ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
<?php
//print_r($_POST); die();
// ✅ Google reCAPTCHA verification
$secretKey = "6LfitPkrAAAAAEvNs4Gmrc_Xc-oJviIpqJ_mnBAh"; // Replace with your secret key
if (empty($_POST['g-recaptcha-response'])) {
die("<script>alert('Please complete the CAPTCHA'); window.history.back();</script>");
}
$verifyResponse = file_get_contents(
'https://www.google.com/recaptcha/api/siteverify?secret=' . urlencode($secretKey) . '&response=' . urlencode($_POST['g-recaptcha-response'])
);
$responseData = json_decode($verifyResponse);
if (!$responseData->success) {
die("<script>alert('CAPTCHA verification failed. Please try again.'); window.history.back();</script>");
}
$SITE_URL = '';
$SITE_URL .= isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? 'https' : 'http';
$SITE_URL .= '://'.$_SERVER['SERVER_NAME'];
//print_r($_SERVER['HTTP_REFERER']); die();
//if($_POST['form_name'] != 'inquiry'){
if(empty($_SERVER['HTTP_REFERER'])){
header('Location: '.$SITE_URL.'?e=0');
exit;
}
if(empty($_POST['form_name']) /*|| ($_POST['form_name'] == 'booking-form' && stripos($_SERVER['HTTP_REFERER'], 'index.php') === false)*/){
header('Location: '.$SITE_URL.'?e=1');
exit;
}
if(!empty($_POST['website']) || stripos($_SERVER['HTTP_REFERER'], 'agradaytourpackages.com') === false /*|| stripos($_SERVER['HTTP_REFERER'], 'contact_mail.php') !== false*/){
//echo $_SERVER['HTTP_REFERER'];
header('Location: '.$SITE_URL.'?e=2');
exit;
}
extract($_POST);
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
require 'PHPMailer/src/Exception.php';
require 'PHPMailer/src/PHPMailer.php';
require 'PHPMailer/src/SMTP.php';
//Create an instance; passing `true` enables exceptions
$mail = new PHPMailer(true);
try {
//Server settings
//$mail->SMTPDebug = SMTP::DEBUG_SERVER; //Enable verbose debug output
$mail->isSMTP(); //Send using SMTP
$mail->Host = 'smtp.gmail.com'; //Set the SMTP server to send through
$mail->SMTPAuth = true; //Enable SMTP authentication
$mail->Username = 'agradaytourpackages@gmail.com'; //SMTP username
$mail->Password = 'phnqyynmjxsmrlmb'; //SMTP password
$mail->SMTPSecure = PHPMailer::ENCRYPTION_SMTPS; //Enable implicit TLS encryption
$mail->Port = 465; //TCP port to connect to; use 587 if you have set `SMTPSecure = PHPMailer::ENCRYPTION_STARTTLS`
//Recipients
$mail->setFrom('agradaytourpackages@gmail.com', 'Quick Enquiry');
$mail->addAddress($email, $fname); //Add a recipient
$mail->addAddress('agradaytourpackages@gmail.com', 'Quick Enquiry');
//Attachments
//$mail->addAttachment('/tmp/image.jpg', 'new.jpg'); //Optional name
//Content
$mail->isHTML(true); //Set email format to HTML
$mail->Subject = 'Quick Enquiry - Agra Day Tour Packages';
$mail->Body = '<table style="border-collapse: collapse; margin: 20px auto;">
<thead>
<tr>
<th colspan="2" style="border: 1px solid #b4b4b4; padding: 7px; background-color: #f2f2f2;">Quick Enquiry</th>
</tr>
</thead>
<tbody>
<tr>
<td style="border: 1px solid #b4b4b4; padding: 7px; font-weight: bold;">Your Name : </td>
<td style="border: 1px solid #b4b4b4; padding: 7px;">'.$fname.'</td>
</tr>
<tr>
<td style="border: 1px solid #b4b4b4; padding: 7px; font-weight: bold;">Email Id :</td>
<td style="border: 1px solid #b4b4b4; padding: 7px;">'.$email.'</td>
</tr>
<tr>
<td style="border: 1px solid #b4b4b4; padding: 7px; font-weight: bold;">Phone Number : </td>
<td style="border: 1px solid #b4b4b4; padding: 7px;">'.$phone.'</td>
</tr>
<tr>
<td style="border: 1px solid #b4b4b4; padding: 7px; font-weight: bold;">Travel Date : </td>
<td style="border: 1px solid #b4b4b4; padding: 7px;">'.$tdate.'</td>
</tr>
<tr>
<td style="border: 1px solid #b4b4b4; padding: 7px; font-weight: bold;">No. of Pax : </td>
<td style="border: 1px solid #b4b4b4; padding: 7px;">'.$adults.'</td>
</tr>
<tr>
<td style="border: 1px solid #b4b4b4; padding: 7px; font-weight: bold;">Message :</td>
<td style="border: 1px solid #b4b4b4; padding: 7px;">'.$message.'</td>
</tr>
</tbody>
</table>';
//$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
$mail->send();
print "<meta http-equiv=\"refresh\"content=\"1; URL=thankyou.php\">";
} catch (Exception $e) {
echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}";
}
?>