Password Change

All Field must be entered.
'; // die(); // } $previousPass = ($_POST['previousPass']); $newPass = ($_POST['newPass']); $conformPass = ($_POST['conformPass']); if($newPass !== $conformPass){ // $errors['password'] = "Confirm password not matched!"; echo "New Password & Confirm password not matched!"; header("location: {$hostname}/admin/changePass.php"); } $email = $_SESSION["email"]; $sql = "SELECT * FROM admin WHERE email = '{$email}' AND password = '{$previousPass}'"; $result = mysqli_query($conn, $sql) or die("Query Failed"); if(mysqli_num_rows($result) > 0){ $sql1 = "UPDATE admin SET password = '{$newPass}' WHERE email = '{$email}'"; $result1 = mysqli_multi_query($conn,$sql1); if($result1){ // echo '
Password Changed has been Successfully!
'; // header("location: {$hostname}/admin/index.php"); $_SESSION['status'] = "Password Changed has been Successfully!"; $_SESSION['status_code'] = "success"; } }else{ echo '
Old Password is incorrect!
'; } } ?>