Uhm... prova a scrivere l'ultimo IF cosi', tanto per iniziare:

if ($user_ok && $password_ok)