authenticate($un,$pwd,$connection); if ($result->next()) { session_register("uname"); $uname=$un; $sid=session_id(); $_SESSION["uname"]=$uname; $_SESSION["sid"]=$sid; $success="authenticated"; } unset($result); $numFriendshipReq = $register->numFriendshipRequests($un,$connection); $_SESSION["friendshipreqs"] = $numFriendshipReq; } if(!is_null($success)){ header("Location:index.php?flag=".$success); }else{ header("Location:index.php"); } ?>