} return false; } //$msg = ''; if (session_is_registered(S_ID)) { header("Location: index.php"); exit; } if (isset($_GET["name"]) && isset($_GET["challenge"])) { if ($user_id = Check($_GET["name"], $_GET["challenge"])) { session_register(S_ID); $_SESSION[S_ID]["user_id"] = $user_id; $_SESSION[S_ID]["ip_login"] =& $_SERVER["REMOTE_ADDR"]; $_SESSION[S_ID]["time_login"] = time(); //$_SESSION[S_ID]["menu_id"] = 0; $good = true; try { $sys_user = new System_User($db, $user_id); $sys_user->Login(); } catch (Exception $e) { $msg = $e->getMessage(); $good = false; session_destroy(); } if ($good) { header("Location: index.php"); exit; } } } Login($msg);