Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $email = $_POST['email'];
- $newpassword = hash('sha256',($_POST['newpassword']));
- $cnewpassword = hash('sha256',($_POST['cnewpassword']));
- $generatedKey = hash('sha256',(mt_rand(10000,99999).time().$email));
- $sqlUpdate = ("UPDATE tbuser SET userPwd = '$newpassword'
- WHERE userMail = '$email' ");
- $sqlUpdate2 = ("UPDATE tbuser SET userGeneratedKey = '$generatedKey'
- WHERE userMail = '$email' ");
- $sqlUpdate3 = ("UPDATE tbuser SET userStatus = 'Activation'
- WHERE userMail = '$email' ");
- if (mysqli_query($db_connexion, $sqlUpdate)) {
- if(mysqli_query($db_connexion, $sqlUpdate2)){
- echo"| activation key sent to '$email'. |";
- }
- if(mysqli_query($db_connexion, $sqlUpdate3)){
- echo"| status updated\n. |";
- }
- echo "| Password updated, please activate account!.|";
- $source = "Admin";
- $message = "Password updated, please activate account!";
- $sujet = "CHANGING PASSWORD ON HE201137";
- $msg = "Password updated, please activate account!;
- Message: $message \n;
- Clé d'activation: http://193.190.65.94/he201137/ESSAIS/activation.php?generatedKey=$generatedKey";
- $entete = "From: $source \n Reply-To: $email";
- $sujetCopie = "(Copie) Inscription sur le site";
- mail($email, $sujet, $msg, $entete);
- } else {
- echo "Error: " . $sqlUpdate . "<br>" . mysqli_error($db_connexion);
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement