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