%PDF- %PDF-
Direktori : /home/eirtvhdf/www/testbeta/ |
Current File : /home/eirtvhdf/www/testbeta/custom_link.php |
<?php include("header.php"); use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\Exception; require 'PHPMailer/src/Exception.php'; require 'PHPMailer/src/PHPMailer.php'; require 'PHPMailer/src/SMTP.php'; if(isset($_POST['btn'])){ $plan=htmlspecialchars($_POST['Plan']); $email=htmlspecialchars($_POST['Email']); $amount=$_POST['Amount']; $token = uniqid(); $tokenLink = "https://www.visiondesignsolution.co.uk/order.php?token=".$token; if(empty($plan) || empty($email) || empty($amount)){ $warn = "<div class=\"alert alert-warning\"> <strong> Warning!</strong> please fill out required fields </div>"; }else{ $query="INSERT INTO `ms_custom_link`(`id`, `token`, `plan_id`, `amount`, `email`, `datetime`) VALUES ('','$token','$plan','$amount','$email',now())"; if(mysqli_query($con, $query)){ $isSent = 0; $message = "\n Hello,"; $message .= "\n"; $message .= " \n Please find the payment link down below:"; $message .= "\n Token: " . $tokenLink; $message .= "\n"; $message .= "\nRegards"; $message .= "\n Vision Design Solution Team"; $mail = new PHPMailer; //Enable SMTP debugging // 0 = off (for production use) // 1 = client messages // 2 = client and server messages //Set the hostname of the mail server $mail->Host = 'mail.visiondesignsolution.co.uk'; //Set the SMTP port number - likely to be 25, 465 or 587 $mail->Port = 25; //Whether to use SMTP authentication $mail->SMTPAuth = true; //Username to use for SMTP authentication $mail->Username = 'sales@visiondesignsolution.co.uk'; //Password to use for SMTP authentication $mail->Password = 'X;~9PQBHFM4-'; $mail->setFrom('sales@visiondesignsolution.co.uk', 'VisionDesignSolution'); $mail->addAddress($email); $mail->Subject = 'Token From Vision Design Solution'; $mail->Body = $message; if (!$mail->send()) { // echo 'Message was not sent.'; echo 'Mailer error: ' . $mail->ErrorInfo; } else { echo ''; $isSent = 1; } $success = "<div class=\"alert alert-success\"> <span class=\"fa fa-check-circle\"></span> <strong>Well done!</strong> Message Successfully Send </div>"; } } } include("views/custom_link.html"); include("footer.php"); ?>