in reply to setting a cookie on login

Oh, I see I forgot to answer your question:
My question is: how can I set it so that the user can stay logged in between pages (eg. use a cookie) without storing the password somewhere in plaintext to check $passhash against? Sorry if I've gone about this whole thing completely the wrong way.
You don't need to store the password in the plain:
if ($passhash eq crypt($incoming_password,$passhash)) { # $incoming_password is correct }
You only need to store the encrypted passwords.
I must be going blind, you're already doing this.