<?php

if(isset($_POST['idUser']) && isset($_POST['pass'])){

    require_once "connection.php";


    $idUser = $_POST['idUser'];
    $pass = $_POST['pass'];


    $sql = "select * from tblUser where idUser='$idUser'";

    $result = $con->query($sql);

    if($result->num_rows > 0){
        while($row = $result->fetch_assoc()) {
            if (password_verify($pass,$row["pass"])){
                echo "success";
            }else{
                echo "failure";
            }
        }
        
    } else{

        echo "failure";
    }
}
?>