ob_start();
ob_clean();
session_start();
include 'adminln/dilg/cnt/join.php';
include "global-values.php";
include "global-functions.php";
$id = isset($_GET['menu_id']) ? intval($_GET['menu_id']) : 1;
$stmt = $conn->prepare("SELECT * FROM `products` WHERE menu_id = ? ORDER BY id ASC");
$stmt->bind_param("i", $id);
$stmt->execute();
$select_product_id = $stmt->get_result();
$rows_R = mysqli_fetch_array($select_product_id);
if ($rows_R) {
foreach ($rows_R as $K1 => $V1) {
if (!is_numeric($K1)) {
$$K1 = $V1;
}
}
$menu = $rows_R['type'];
}
?>
Software Company in Coimbatore|Jithwin Technologies
$Pagename = basename($_SERVER['PHP_SELF']);
$stmt_settings = $conn->prepare("SELECT * FROM setting LIMIT 1");
$stmt_settings->execute();
$result_settings = $stmt_settings->get_result();
$rows_R = $result_settings->fetch_assoc();
if ($rows_R) {
foreach ($rows_R as $K1 => $V1) {
if (!is_numeric($K1)) {
$$K1 = $V1;
}
}
}
use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception;
require_once __DIR__ . '/PHPMailer/src/Exception.php';
require_once __DIR__ . '/PHPMailer/src/PHPMailer.php';
require_once __DIR__ . '/PHPMailer/src/SMTP.php';
$demoSuccess = "";
if ($_SERVER["REQUEST_METHOD"] == "POST" && isset($_POST['form_type']) && $_POST['form_type'] == 'demo') {
// reCAPTCHA verification
if (isset($_POST['g-recaptcha-response']) && !empty($_POST['g-recaptcha-response'])) {
$secretKey = "6Lf4IZEsAAAAAFEBoANvD2K51KC2WSu9n2XrlT1U";
$captchaResponse = $_POST['g-recaptcha-response'];
$verifyURL = "https://www.google.com/recaptcha/api/siteverify?secret=" . $secretKey . "&response=" . $captchaResponse;
$response = file_get_contents($verifyURL);
$responseKeys = json_decode($response, true);
if ($responseKeys["success"]) {
// Get form values safely
$demoName = $_POST['name'] ?? '';
$demoEmail = $_POST['email'] ?? '';
$demoPhone = $_POST['phone'] ?? '';
$demoCategory = $_POST['category'] ?? '';
$demoMessage_content = $_POST['message'] ?? '';
if (!empty($demoName) && !empty($demoEmail) && !empty($demoPhone)) {
// SMTP MAIL (CPANEL CONFIG)
$mail = new PHPMailer(true);
try {
$mail->isSMTP();
$mail->Host = 'mail.jithwin.com';
$mail->SMTPAuth = true;
$mail->Username = 'support@jithwin.com';
$mail->Password = '[hbvD^Ng4k1P@Oaw';
$mail->SMTPSecure = 'ssl';
$mail->Port = 465;
$mail->SMTPOptions = [
'ssl' => [
'verify_peer' => false,
'verify_peer_name' => false,
'allow_self_signed' => true
]
];
$mail->setFrom('support@jithwin.com', 'Request Demo');
$mail->addAddress('support@jithwin.com');
$mail->addReplyTo($demoEmail, $demoName);
$mail->isHTML(false);
$subject = "Request Demo: " . $demoCategory;
$mail->Subject = $subject;
$mail->Body =
"Form Type: Request Demo\n" .
"Name: $demoName\n" .
"Email: $demoEmail\n" .
"Phone: $demoPhone\n" .
"Category: $demoCategory\n\n" .
"Message:\n$demoMessage_content";
$mail->send();
$demoSuccess = "Message submitted successfully!";
$_POST = [];
} catch (Exception $e) {
$demoSuccess = "Error sending message: " . $mail->ErrorInfo;
}
}
}
}
}
?>