Anche qui

if ($username && $password){

devi usare $_POST['...']