hget("users",$username); if (!$userid) goback("Wrong username or password"); $realpassword = $r->hget("user:$userid","password"); if ($realpassword != $password) goback("Wrong useranme or password"); # Username / password OK, set the cookie and redirect to index.php $authsecret = $r->hget("user:$userid","auth"); setcookie("auth",$authsecret,time()+3600*24*365); header("Location: index.php"); ?>