SESSION['mks_id'])){ header('location: index.php'); echo ''; } use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\Exception; include 'function.php'; include 'dbnew.php'; $ref=$_GET['ref'] ?? ''; if(isset($_POST['btn-signup'])) { $address = test_input($_POST['address'] ?? ''); $city = test_input($_POST['city'] ?? ''); $thana = test_input($_POST['thana'] ?? ''); $w_area = test_input($_POST['w_area'] ?? ''); $profession = test_input($_POST['profession'] ?? ''); $bkash = test_input($_POST['bkash'] ?? ''); $rocket = test_input($_POST['rocket'] ?? ''); $imgFile = $_FILES['img']['name']; $tmp_dir = $_FILES['img']['tmp_name']; $imgSize = $_FILES['img']['size']; $balance= 20; $ex=1; $fname = test_input($_POST['txtfname'] ?? ''); $mobile = test_input($_POST['txtmobile'] ?? ''); $email = test_input($_POST['txtemail'] ?? ''); $upass = test_input($_POST['txtpass'] ?? ''); if (empty($ref)){ $ref=test_input($_POST['ref'] ?? ''); } $code = "1234567890abcdefjhijklmnopqrstuvwxyz.,!*"; $code=str_shuffle($code); $token=substr($code, 0, 20); $pass1= password_hash($upass, PASSWORD_BCRYPT); $check=$pdo->query("select * from tbl_users where userEmail= '$email'")->rowCount(); if ($check >= 1){ $msgs = "Email Address allready exists , Please Try another one"; } else { $upload_dir = 'images/users/'; // upload directory $imgExt = strtolower(pathinfo($imgFile,PATHINFO_EXTENSION)); // get image extension // valid image extensions $valid_extensions = array('jpeg', 'jpg', 'png', 'gif'); // valid extensions // rename uploading image $userpic = rand(1000,1000000).".".$imgExt; // allow valid image file formats if(in_array($imgExt, $valid_extensions)){ // Check file size '5MB' if($imgSize < 5000000) { move_uploaded_file($tmp_dir,$upload_dir.$userpic); } else{ $msg = "Sorry, your file is too large."; } } else{ $msg = "Sorry, only JPG, JPEG, PNG & GIF files are allowed."; } } $insert=$pdo->query("INSERT INTO tbl_users (fullName, userEmail, mobile, userPass, address, city, thana, w_area, profession, balance, bkash, rocket, ref, ex, tokenCode, img, date) values ('$fname', '$email', '$mobile', '$pass1','$address', '$city', '$thana', '$w_area', '$profession', '$balance', '$bkash', '$rocket', '$ref', '$ex', '$token', '$userpic', NOW()) "); require 'mailer/autoload.php'; $mail = new \PHPMailer\PHPMailer\PHPMailer(true); $mail->SMTPDebug = 0; // Enable verbose debug output $mail->isSMTP(); // Set mailer to use SMTP $mail->Host = 'mtolet.com'; // Specify main and backup SMTP servers $mail->SMTPAuth = true; // Enable SMTP authentication $mail->Username = 'signup@mtolet.com'; // SMTP username $mail->Password = 'signupmtolet852319hsc'; // SMTP password $mail->SMTPSecure = \PHPMailer\PHPMailer\PHPMailer::ENCRYPTION_STARTTLS; // Enable TLS encryption, `ssl` also accepted $mail->Port = 587; $mail->setFrom('signup@mtolet.com', 'M Tolet'); $mail->addReplyTo('signup@mtolet.com', 'Please do not reply in this email.'); $mail->addAddress($email, $fname); $mail->Subject= "Please verify your Email. Mtolet.com"; $mail->isHTML(true); $mail->Body = file_get_contents("signup-email.php"); $mail->AltBody = strip_tags($mail->Body); try { $mail->send(); } catch (\PHPMailer\PHPMailer\Exception $e) { error_log('Mailer Error: ' . $mail->ErrorInfo); } if (true){ $msg= "আপনার একাউন্ট টি সফল ভাবে খোলা হয়েছে , আপনার ইমেইল একাউন্টে একটি ইমেইল গেছে । একাউন্টটি একটিভ করে নিন । ধন্যবাদ । "; $login=$pdo->query("select * from tbl_users where userEmail='$email'")->fetch(PDO::FETCH_BOTH); $uid=$login['userID']; $_SESSION['mks_id']=$uid; } elseif (!$mail->send()){ $msg= "something is wrong in sending email, please try anather or leter."; } if (!empty($ref)){ $bbb = $pdo->query("select * from tbl_users where userID= '$ref'"); $aff = $bbb->fetch(PDO::FETCH_BOTH); $Balance_up = $aff['balance']; $up_balance = $Balance_up + 20; $update =$pdo->query("UPDATE tbl_users SET balance='$up_balance' WHERE userID='$ref' "); header('location: index.php'); echo ''; } } ?> Affiliate Sign Up