Formen Sie Daten zur PHP -Klasse

function login(Array $data){
    // Whatever your code does
}

if($_POST['action'] == "login") {
    login($_POST);
}
Shy Sandpiper