I would suggest you to use md5 encryption, because there is no way to decript an md5 hash... of course its still possible to compare them in the database as encrypting the password tom will always give the same hash
e.g:
// register.php //
$md5pw = md5($pw);
//store $md5pw in db//
//use a varchar(32) field//
// login.php //
//use a form for input//
if(!isset($password_from_form)) {
echo "Error, please enter your password";
exit();
} else {
//get user password from db and compare//
if(md5($password_from_form)==$password_from_db) {
setcookie("membercookie", $name, time()+$expiry);
} else {
echo "Error, please enter the correct password";
}
}