I want to create an Ajax-Login, but I'm not sure if my solutions is generally correct. I want to do everything correct, so I need someone who checks this code and give me some improvement hints.public static function Login($username, $password) {    $result = \Helpers\Database::get()->select(SELECT * FROM users WHERE user_username = :user_username, array(:user_username => $username));    if (empty($result)) {        $response[error_message] = User does not exist;    } else {        if (password_verify($password, $result[0]->user_password)) {            $response[success] = true;            \Helpers\Session::set(user, $result[0]->user_id);        } else {            $response[error_message] = Password invalid;        }    }    echo json_encode($response);}$(#login_form).submit(function(e) {    e.preventDefault();    var username = $(input[name=username]).val();    var password = $(input[name=password]).val();    $.ajax({        url: login/authentificate,        type: POST,        data: {username: username, password: password},        success: function(response) {            alert(response);        },        error: function(error) {            console.log(error);        }    });});
Ajax login response
javascript;jquery;ajax;authentication