include("includes/functions.php");
$db=mysql_connect("localhost", "web12702", "ddCkXfM22");
mysql_select_db("web12702_shop", $db);
if ( count($_POST) && $_POST['email'] ) {
// Get customer by email
$custResult = mysql_query("SELECT * FROM customers WHERE email = '".$_POST['email']."'");
// If customer
if ( mysql_num_rows($custResult) ) {
// fetch customer details
$customer = mysql_fetch_assoc($custResult);
// reset password
$password = genCode();
mysql_query("UPDATE customers SET password = '".md5($password)."' WHERE email = '".$_POST['email']."'");
// email new password to customer
$mail = new PHPMailer();
$mail->Subject = 'Password reset';
$mail->From = 'shop@sharplift.com.au';
$mail->FromName = 'Sharplift';
$mail->Body = "Hi ".$customer['name'].",\n\nYou have requested to reset your password. Below is your new password:\n\n"
. "Username: ".$customer['email']."\nPassword: ".$password."\n\n"
. "You can login here: https://shop.sharplift.com.au/client/login.php\n\nKind regards,\nThe team at Sharplift";
$mail->IsHTML(false);
$mail->AddAddress($customer['email'],$customer['email']);
if ( !$mail->Send() ) {
throw new Exception('An error occured sending the confirmation email!');
}
redirect('/client/login2.php');
}
}
?>
Sharplift Control Panel
|
|
|
|
 |
Login
|
 |
|
|
|
|
|
|
|
|
© 2026 Sharplift Control Panel
|