diff --git a/api/db.php b/api/db.php index 55d30dc..ec064da 100644 --- a/api/db.php +++ b/api/db.php @@ -1,9 +1,9 @@ $hash_cat, 'ip'=>$uip)); -} -else { - echo json_encode(array('x'=>"will never happened, like never. this is not supposed to work", 'ip'=>$uip)); -} -//json($dog,$hash_cat,$uip); +if ($rus->num_rows > 0) { + echo "** found user **"; + while($row = $rps->fetch_assoc()) { + $oof = password_verify($cat, $row["pass"]); + if ($oof) + { + jsonLogin("oof","moof","1234"); + } + else + { + echo "***** nope"; + } + } + } else { + echo "no result :("; + } + $conn->close(); -function json($x, $y, $ip) +function jsonLogin($x, $y, $ip) { header("Content-type: application/json"); echo json_encode(array('x'=>$x, 'y'=>$y, 'ip'=>$ip));