Well, I can see this test being made:
($line[1] == crypt ($_POST['password'], $line[1]) ) )
and I wonder how often that's going to be true. It has to be true, or $loggedin won't be set to true. It's anyone's guess what is supposed to be getting compared here, but I'm pretty sure that this doesn't do it.