Файловый менеджер - Редактировать - /home/d46091/drivinglicencehelp.com/submit.php
Назад
<?php session_start(); ob_start(); include_once('config.php'); include_once('easebuzz-lib/easebuzz_payment_gateway.php'); date_default_timezone_set('Asia/Kolkata'); $date = date('d-m-Y H:i:s'); $TodayDate = date('d-m-Y'); die(); function generateTxnId($length = 7) { $chars = 'abcdefghijklmnopqrstuvwxyz1234567890'; $token = ''; while(strlen($token) < $length) { $token .= $chars[mt_rand(0, strlen($chars)-1)]; } return strtoupper('DL-2021-' . $token); } // Get the user's IP address $ip = $_SERVER['REMOTE_ADDR']; $userAgent = $_SERVER['HTTP_USER_AGENT']; $timestamp = date('Y-m-d H:i:s'); $logEntry = "[$timestamp] IP: $ip | SUBMIT | User-Agent: $userAgent" . PHP_EOL; $logFile = 'user_logs.txt'; file_put_contents($logFile, $logEntry, FILE_APPEND | LOCK_EX); use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\Exception; require 'vendor/autoload.php'; $payment_id = ''; $orderId = generateTxnId(11); $applicant_name = urlencode($_POST['applicant_name']); $mobile_number = urlencode($_POST['mobile_number']); $email_id = urlencode($_POST['email_id']); if(isset($_POST['state'])) { $state = urlencode($_POST['state']); } elseif(isset($_POST['office_state'])) { $state = urlencode($_POST['office_state']); }else{ $state = '-'; } if( (isset($_POST['form_id'])&& $_POST['form_id'] =='dl_licence_guide') ) { $suspicious_patterns = [ '/https?:\/\/[^\s]+/', '/\b(?:ticke|attention|save|freeze|funds|protect|here|urgent|offer)\b/i', ]; if (preg_match('/<[^>]*>|<\/?script.*?>/i', $applicant_name) || strlen($applicant_name) > 50) { exit("Invalid applicant name."); } foreach ($suspicious_patterns as $pattern) { if (preg_match($pattern, $applicant_name)) { exit("Invalid applicant name. It contains suspicious content."); } } if (!preg_match('/^[6789]\d{9}$/', $mobile_number)) { exit("Invalid mobile number. It must be a 10-digit number starting with 6, 7, 8, or 9."); } $_SESSION['table_id'] = 'licence_guide_book_form'; $payment_status = 'Unpaid'; $product_price = 525; if((isset($_POST['coupon'])) && ((strtoupper($_POST['coupon']) == 'OFFER200'))){ $product_price = 525 - 200; } $sql = " INSERT INTO licence_guide_book_form ( form_name, applying_for, applicant_name, mobile_number, email_id, address, state, district, landmark, pincode, total_amount, payment_status, form_created_on, c_gateway, c_gateway_merchant, payment_stage, form_created_date, payment_id, order_id ) VALUES ( '".$_POST["form_name"]."', '".$_POST["applying_for"]."', '".$_POST["applicant_name"]."', '".$_POST["mobile_number"]."', '".$_POST["email_id"]."', '".$_POST["present_address"]."', '".$_POST["office_state"]."', '".$_POST["office_district"]."', '".$_POST["landmark"]."', '".$_POST["pincode"]."', '".$product_price."', '".$payment_status."', '".$date."', '".$currentPaymentGateway."', '".$merchantEmail."', '".$stage."', '".$TodayDate."', '".$payment_id."', '".$orderId."' )"; if(!$result = $conn->query($sql)) { die('There was an error running the query [' . $conn->error . ']'); } else { $_SESSION["form_id"] = $conn->insert_id; $form_name = urlencode($_POST["form_name"]); // $api_url = "https://demolounge.in/admin/api_insert_sales.php"; // $data = [ // 'site_url' => 'https://'.strtolower('drivinglicencehelp.com'), // 'form_name' => $_POST["form_name"], // 'business_area' => 'DL', // 'cus_full_name' => $_POST['applicant_name'], // 'cus_mobile' => $mobile_number, // 'cus_email' => $email_id, // 'state' => $_POST['office_state'], // 'order_id' => $orderId, // 'payment_amount' => 525 // ]; // $ch = curl_init($api_url); // curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); // curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']); // 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); $ch = curl_init('https://msmebiz.shop/api/registration-form-submission.php?formId='.$_SESSION["form_id"].'&vendor=TTG&business=DL&website=DRIVINGLICENCEHELP.COM&amount='.$product_price.'&status=Unpaid&name='.$applicant_name.'&mobile='.$mobile_number.'&email='.$email_id.'&state='.$state.'&formName='.$form_name.''); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); $_SESSION["panel_form_id_2"] = $response; $_SESSION['form_name'] = $_POST['form_name']; $_SESSION['applicant_name'] = $_POST['applicant_name']; $_SESSION['mobile_number'] = $_POST['mobile_number']; $_SESSION['email_id'] = $_POST['email_id']; $_SESSION['total_amount'] = $product_price; $_SESSION['order_id'] = generateTxnId(17); // $api_url = "https://demolounge.in/admin/api_insert_sales.php"; // $data = [ // 'site_url' => 'https://'.strtolower('drivinglicencehelp.com'), // 'form_name' => $_POST["form_name"], // 'business_area' => 'DL', // 'cus_full_name' => $_POST['applicant_name'], // 'cus_mobile' => $_POST['mobile_number'], // 'cus_email' => $email_id, // 'state' => $_POST['email_id'], // '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/json']); // 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->SMTPDebug = 2; $mail->Host = 'smtp.hostinger.com'; $mail->SMTPAuth = true; $mail->Username = 'no-reply@drivinglicencehelp.com'; $mail->Password = 'freeDOM@611#'; $mail->SMTPSecure = 'tls'; $mail->Port = 587; $mail->setFrom("no-reply@drivinglicencehelp.com", "Driving Licence Registration"); $mail->addAddress("".$_POST["email_id"].""); $mail->isHTML(true); $mail->Subject = "Your ".$_POST["form_name"]." Submitted Successfully"; $mail->Body = " Dear <strong>".$_POST["applicant_name"]."</strong>, <br><br> Thank you for submitting your application for ".$_POST["form_name"]." on our website. <br><br> "; $mail->send(); $mail->ClearAllRecipients(); $mail->addAddress("no-reply@drivinglicencehelp.com"); $mail->isHTML(true); $mail->Subject = "New ".$_POST["form_name"]." Form Submitted"; $mail->Body = "APPLICANT NAME: ".$_POST["applicant_name"]."<br> MOBILE NUMBER: ".$_POST['mobile_number']."<br> EMAIL ID: ".$_POST['email_id']." "; $mail->send(); } catch (Exception $e) { echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}"; } } include_once("editable/submit-form.php"); // Easebuzz Payment $easebuzzObj = new Easebuzz($MERCHANT_KEY, $SALT, $ENV); $postData = array ( "txnid" => "".$_SESSION['order_id']."", "amount" => "".$product_price.".00"."", "firstname" => "".$_POST["applicant_name"]."", "email" => "".$_POST["email_id"]."", "phone" => "".$_POST["mobile_number"]."", "productinfo" => "".$_POST["form_name"]."", "surl" => "https://drivinglicencehelp.com/response.php", "furl" => "https://drivinglicencehelp.com/response.php", "udf1" => "".$_SESSION["form_id"]."", "udf2" => "licence_guide_book_form", ); $easebuzzObj->initiatePaymentAPI($postData); } die(); // Enquiry if(isset($_POST["submit"])) { $sql=" INSERT INTO licence_guide_book_form ( form_name, applicant_name, mobile_number, email_id, form_created_on ) VALUES ( '".$_POST["form_name"]."', '".$_POST["applicant_name"]."', '".$_POST["mobile_number"]."', '".$_POST["email_id"]."', '".$date."' )"; if(!$result = $conn->query($sql)){ die('There was an error running the query [' . $conn->error . ']'); } else { $_SESSION["form_id"] = $conn->insert_id; $product_price = 'ENQUIRY'; // ---------------------------------- $post = [ 'api_key' => 123456, 'formId' => $_SESSION["form_id"], 'vendor' => 'TTG', 'business' => 'DL', 'website' => 'drivinglicencehelp.com', 'amount' => $product_price, 'status' => 'Unpaid', 'name' => $_POST['applicant_name'], 'mobile' => $_POST['mobile_number'], 'email' => $_POST['email_id'], 'state' => $_POST['state'], 'formName' => $_POST['form_name'], 'orderId' => $orderId, ]; $ch = curl_init('https://newcrm.techlounge.co.in/v1/form-data-send-to-crm'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); curl_setopt($ch, CURLOPT_POSTFIELDS, $post); $response = curl_exec($ch); curl_close($ch); // -------------------------------------- $ch = curl_init('https://msmebiz.shop/api/registration-form-submission.php?formId='.$_SESSION["form_id"].'&vendor=TTG&business=DL&website=DRIVINGLICENCEHELP.COM&amount='.$product_price.'&status=Unpaid&name='.$applicant_name.'&mobile='.$mobile_number.'&email='.$email_id.'&state='.$state.''); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); $_SESSION["panel_form_id_2"] = $response; $ch = curl_init('https://crm5.in/api/registration-form-submission.php?formId='.$_SESSION["form_id"].'&vendor=TTG&business=DL&website=DRIVINGLICENCEHELP.COM&amount='.$product_price.'&status=Unpaid&name='.$applicant_name.'&mobile='.$mobile_number.'&email='.$email_id.'&state='.$state.''); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $response = curl_exec($ch); curl_close($ch); $_SESSION["panel_form_id_5"] = $response; $form_name = urlencode($_POST["form_name"]); // Mailer $mail = new PHPMailer(true); try { $mail->isSMTP(); $mail->Host = 'smtp.hostinger.com'; $mail->SMTPAuth = true; $mail->Username = 'no-reply@drivinglicencehelp.com'; $mail->Password = 'freeDOM@611#'; $mail->SMTPSecure = 'tls'; $mail->Port = 587; $mail->setFrom("no-reply@drivinglicencehelp.com", "Driving Licence Registration"); $mail->addAddress("".$_POST["email_id"].""); $mail->isHTML(true); $mail->Subject = "Your ".$_POST["form_name"]." Submitted Successfully"; $mail->Body = " Dear <strong>".$_POST["applicant_name"]."</strong>, <br><br> Thank you for submitting your application for ".$_POST["form_name"]." on our website. <br><br> "; $mail->send(); $mail->ClearAllRecipients(); $mail->addAddress("no-reply@drivinglicencehelp.com"); $mail->isHTML(true); $mail->Subject = "New ".$_POST["form_name"]." Form Submitted"; $mail->Body = "APPLICANT NAME: ".$_POST["applicant_name"]."<br> MOBILE NUMBER: ".$_POST['mobile_number']."<br> EMAIL ID: ".$_POST['email_id']." "; $mail->send(); } catch (Exception $e) { echo "Message could not be sent. Mailer Error: {$mail->ErrorInfo}"; } echo "<script>alert('Thanks For submiting your enquiry form, Our Team Will assist you shortly.')</script>"; echo "<script>setTimeout(\"location.href = 'index.php';\",300);</script>"; } } ?>
| ver. 1.4 |
Github
|
.
| PHP 8.1.32 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка