"; $error=1; } if ($captcha=="") { $error_string .= "Enter captcha code
"; $error=1; } if($_POST['captcha'] != $_SESSION['digit']) { $error_string .= "Sorry, captcha validation failed.
"; $error=1; } $chkrsq = mysqli_query($con,"select MemberId, Email, FirstName, LastName from members where Email='".mysqli_real_escape_string($con,$Email)."'"); if (mysqli_num_rows($chkrsq)==0) { $error_string .= "Sorry, this email is not registered with us.
"; $error=1; }else { $chkrs = mysqli_fetch_assoc($chkrsq); $MemberId = $chkrs['MemberId']; $Email = $chkrs['Email']; $FirstName = $chkrs['FirstName']; $LastName = $chkrs['LastName']; if ($MemberId=="") { $error_string .= "Sorry, we could not track your membership.
"; $error=1; } } if ($error==1) { $error = '{"status":"validation_failed", "message":"'.$error_string.'"}'; die($error); }else { $token = generateRandomString(50); $url = USERPATH . "reset-password-action?token=" . $token; $sql = "insert into passwordtokens set MemberId='".$MemberId."', Token='".$token."', CreatedOn='".gmdate("Y-m-d H:i:s")."', isUsed='0'"; $template = ' Discount Light
Forgot your password?
No problem, it happens! Please select the button below to initiate the password reset.
Reset Your Password
You are receiving this email because it is associated with your registration with us.
© 2024 Web3Preneur, All Rights Reserved.
'; require_once('PHPMailer_5.2.4/class.phpmailer.php'); $Subject = "Reset your " . PROJECT_TITLE . " password"; $mail = new PHPMailer(); $body = preg_replace('/[\]/','',$body); $mail->IsSMTP(); $mail->Host = "web3preneur.com"; $mail->SMTPDebug = 0; // enables SMTP debug information (for testing) // 1 = errors and messages // 2 = messages only $mail->SMTPAuth = true; // enable SMTP authentication $mail->Host = "web3preneur.com"; // sets the SMTP server $mail->Port = 26; // set the SMTP port for the GMAIL server $mail->Username = "hello@web3preneur.com"; // SMTP account username $mail->Password = "V1CY!gIJzt)2"; // SMTP account password $mail->SetFrom('hello@web3preneur.com', 'Web3Preneur'); $mail->AddReplyTo("hello@web3preneur.com","Web3Preneur"); $mail->Subject = $Subject; $mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; // optional, comment out and test $mail->MsgHTML($template); $mail->AddAddress($Email, $FirstName . " " . $LastName); if(!$mail->Send()) { $error = '{"status":"validation_failed", "message":"'.$mail->ErrorInfo.'"}'; die($error); } else { if (!mysqli_query($con,$sql)) { $error = '{"status":"technical_error", "message":"Apologies, a technical issue occurred."}'; die($error); }else { $error = '{"status":"success", "message":"A password reset link has been dispatched to your email address."}'; die($error); } } } } ?> Forgot password PROJECT_TITLE account

Reset your password

CAPTCHA

Remember your password?
Login