Hello i dont get the $msg shown if my Username and Password is not the correct one.´Here is the php isset Part.

   if(isset($_POST['Submit'])){
$Username = $_REQUEST['Username'];
$Password  = $_REQUEST['Password'];
$hashed_password = '$2y$10$KWpZCg/vOumvk0TFiauhqu2kmBvDw3T0RwdWBrofKfgBkdI8ApyXe';
echo $hashed_password;
$tsql = "SELECT * FROM MasterarbeitDB.dbo.Benutzer";

$stmt = sqlsrv_prepare( $conn, $tsql, array(), array( "Scrollable" => SQLSRV_CURSOR_KEYSET ));
if (sqlsrv_execute($stmt)) {
while( $obj = sqlsrv_fetch_array( $stmt, SQLSRV_FETCH_ASSOC)) {
       if(password_verify($Password, $hashed_password) && $obj['Benutzer'] == $_POST['Username']) {
  $_SESSION['valid_user'] = true;
   $_SESSION['Username'] = $Username;
            header("location:ma_Qualianlegen.php?QualiID=".$QualiID."&TestaufstellungID=".$TestaufstellungID."&Bezeichnung=".$Bezeichnung."&StatusID=".$StatusID."&TID=". $TID ."&AuftragsID=". $AuftragsID ."");
            exit;
        }else {

            $msg="<span style='color:red'>falsche Login-Date</span>";
        } 
}
}
}

Any help why this happen? thx

0 Answers