Formulario de datos a la clase PHP

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

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