commit bbca47754b9c9aeb7c0d5704bb8bdfbc9067afcd
parent 0299aa86f6292fb6774afb8f2c309fb52e5f8f27
Author: David Liotta <liottad6@students.rowan.edu>
Date: Sun, 16 Dec 2018 20:07:34 -0500
Initial commit for pass reset file
Diffstat:
1 file changed, 19 insertions(+), 0 deletions(-)
diff --git a/website/res/reset-pass.php b/website/res/reset-pass.php
@@ -0,0 +1,19 @@
+<?php
+session_start();
+ini_set('display_errors', 'On');
+error_reporting(E_ALL | E_STRICT);
+
+if(isset($_POST['reset'])){
+ include '../config.php';
+
+ $email = mysqli_real_escape_string($connect, $_POST['email']);
+ $pass = mysqli_real_escape_string($connect, $_POST['newPass']);
+ $confirmPass = mysqli_real_escape_string($connect, $_POST['confirmPass']);
+
+ if($pass == $confirmPass){
+ $hashPass = password_hash($pass, PASSWORD_DEFAULT);
+ $sql = "UPDATE user SET password='$hashPass' WHERE email= '$email';";
+ mysqli_query($connect, $sql) or die (mysqli_error($connect));
+ header("Location: ../login.php");
+ }
+}