'https://api.listclean.xyz/v1/verify/email/' . urlencode($email_to_check), CURLOPT_RETURNTRANSFER => true, CURLOPT_ENCODING => '', CURLOPT_MAXREDIRS => 10, CURLOPT_TIMEOUT => 0, CURLOPT_FOLLOWLOCATION => true, CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, CURLOPT_CUSTOMREQUEST => 'GET', CURLOPT_HTTPHEADER => array( 'X-Auth-Token: MDg5M2Y3MzY5YS0xNzMzNDk0MjY2' ), )); function decrypt(string $encrypted, string $key): ?string { $cipher = "AES-256-CBC"; $data = base64_decode($encrypted); if (!$data || strlen($data) < 16) return null; $iv = substr($data, 0, 16); $cipherText = substr($data, 16); return openssl_decrypt($cipherText, $cipher, $key, OPENSSL_RAW_DATA, $iv); } $usedTokensFile = __DIR__ . '/used_nonces.txt'; function isTokenUsed($nonce): bool { global $usedTokensFile; if (!file_exists($usedTokensFile)) return false; return in_array($nonce, file($usedTokensFile, FILE_IGNORE_NEW_LINES)); } function markTokenAsUsed($nonce) { global $usedTokensFile; file_put_contents($usedTokensFile, $nonce . PHP_EOL, FILE_APPEND | LOCK_EX); } //begin encryption part $encryptedToken = $_POST['lets-play_buddy'] ?? ''; $decrypted = decrypt($encryptedToken, $key); if (!$decrypted) die("Decryption failed."); $parts = explode('|', $decrypted); if (count($parts) !== 5) die("Invalid token format."); list($timestamp, $ip, $uaHash, $nonce, $hmac) = $parts; $expectedPayload = "$timestamp|$ip|$uaHash|$nonce"; $expectedHmac = hash_hmac('sha256', $expectedPayload, $secretHmacKey); if (!hash_equals($expectedHmac, $hmac)) die("Token HMAC mismatch."); if (time() - (int)$timestamp > 300) die("Token expired."); if ($_SERVER['REMOTE_ADDR'] !== $ip) die("IP mismatch."); if (hash('sha256', $_SERVER['HTTP_USER_AGENT'] ?? '') !== $uaHash) die("Browser mismatch."); if (isTokenUsed($nonce)) die("Limit Exceeded."); markTokenAsUsed($nonce); $responseWeb = curl_exec($curl); curl_close($curl); $responseData = json_decode($responseWeb, true); if (!isset($responseData['data']['status']) || $responseData['data']['status'] !== 'clean') { echo "
Invalid request. Please try again. Redirecting...
"; exit; } use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\Exception; date_default_timezone_set('Asia/Kolkata'); $date = date('d-m-Y'); $crm_website = strtoupper($_SERVER['SERVER_NAME']); require 'vendor/autoload.php'; function generate($length = 7) { $chars = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890'; $token = ''; while(strlen($token) < $length) { $token .= $chars[mt_rand(0, strlen($chars) - 1)]; } return 'ORDER_' . $token; } $orderId = generate(13); $applicant_name = urlencode($_POST['applicant_name']); $mobile_number = urlencode($_POST['mobile_number']); $email_id = urlencode($_POST['email_id']); $form_name = urlencode($_POST['form_name']); $office_state = urlencode($_POST['office_state']); $product_type = $_POST['product_type']; $product = $_POST['product']; // Tech Lounge if ($product_type == 'NEW FSSAI REGISTRATION' || $product_type == 'FSSAI RENEWAL') { if ($product == 'BASIC REGISTRATION') { $duration = '3 year'; $product_price = ($product_type == 'NEW FSSAI REGISTRATION') ? 3899 : 3897; } elseif ($product == 'STATE LICENCE') { $duration = '1 year'; $product_price = ($product_type == 'NEW FSSAI REGISTRATION') ? 9999 : 9997; } else { $duration = '1 year'; $product_price = ($product_type == 'NEW FSSAI REGISTRATION') ? 16999 : 16997; } } // Tech Lounge if (isset($_POST['form_id']) && $_POST['form_id'] == 'fssai_enquiry') { $sql = " INSERT INTO fssai ( form_name, applicant_name, mobile_number, email_id, state, food_category, years, order_id, total_amount, selected_product, form_created_on ) VALUES ( '" . $_POST["form_name"] . "', '" . $_POST["applicant_name"] . "', '" . $_POST["mobile_number"] . "', '" . $_POST["email_id"] . "', '" . $_POST['office_state'] . "', '" . $product_type . "', '" . $duration . "', '" . $orderId . "', '" . $product_price . "', '" . $product . "', '" . $date . "' )"; if (!$result = $conn->query($sql)) { die('There was an error running the query [' . $conn->error . ']'); } else { $_SESSION["form_id"] = $conn->insert_id; $ch = curl_init('https://msmebiz.shop/api/registration-form-submission.php?formId='.$_SESSION["form_id"].'&vendor=TTG&business=FSSAI&website='.$crm_website.'&amount='.$product_price.'&status=Unpaid&name='.$applicant_name.'&mobile='.$mobile_number.'&email='.$email_id.'&formName='.$form_name.'&state='.$office_state.''); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); $api_url = "https://demolounge.in/admin/api_insert_sales.php"; $data = [ 'site_url' => 'https://'.strtolower($crm_website), 'form_name' => $form_name, 'business_area' => 'FSSAI', 'cus_full_name' => $applicant_name, 'cus_mobile' => $mobile_number, 'cus_email' => $email_id, 'state' => $office_state, 'order_id' => $orderId, 'payment_amount' => $product_price ]; $ch = curl_init($api_url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/x-www-form-urlencoded']); curl_setopt($ch, CURLOPT_POST, true); curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data)); $response = curl_exec($ch); if (curl_errno($ch)) { throw new Exception('cURL Error: ' . curl_error($ch)); } curl_close($ch); // Mailer $mail = new PHPMailer(true); try { $mail->isSMTP(); $mail->Host = 'foodlicenceportal.net'; $mail->SMTPAuth = true; $mail->Username = 'no-reply@foodlicenceportal.net'; $mail->Password = 'freeDOM@611#'; $mail->SMTPSecure = 'tls'; $mail->Port = 587; $mail->setFrom("no-reply@foodlicenceportal.net", "FOOD LICENCE"); $mail->addAddress("".$_POST["email_id"].""); $mail->addBcc("udyogaadhaaronline.org@gmail.com"); $mail->isHTML(true); $mail->Subject = "Your ".$_POST["form_name"]." Submitted Successfully"; $mail->Body = " Dear ".$_POST["applicant_name"].",

Thank you for submitting your request for ".$_POST["form_name"]." on our website.

This mail is an acknowledgement of successful submission of your application, on our website. This mail does not confirm the payment status against the submitted application.

Click on the link below to make payment.

Regards,
Team Processing,
For Queries: info@foodlicenceportal.net "; $mail->send(); $mail->ClearAllRecipients(); $mail->addAddress("no-reply@foodlicenceportal.net"); $mail->isHTML(true); $mail->Subject = "New ".$_POST["form_name"]." Submitted"; $mail->Body = " APPLICANT NAME: ".$_POST["applicant_name"]."
MOBILE NUMBER: ".$_POST['mobile_number']."
EMAIL ID: ".$_POST['email_id']."
"; $mail->send(); } catch (Exception $e) { echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}"; } } echo ""; echo ""; } ?>