<?php
require "db.php";
$login = $_POST['login'];
$password = $_POST['password'];
$user = R::findOne('users', 'login = ?', array($_POST['login']));
if( $user ){
if( password_verify($_POST['password'], $user->password) ) {
echo '1';
} else { echo '2'; } } else { echo '3'; }
?>