ofetch('SELECT 1 FROM users WHERE login = ? OR email = ?', [$login, $email])) { return false; } Db::getInstance()->execute('INSERT INTO users (login,pass,email,borndate,ip,session_id,shadow) VALUES (?,?,?,?,?,?,?)', [$login, $password, $email, $birthday, $_SERVER['REMOTE_ADDR'], session_id(), '0.png']); $userId = Db::getInstance()->lastInsertId(); Db::getInstance()->execute('INSERT INTO online (user_id, login_time, room, real_time) VALUES (?,?,1,?)', [$userId, time(), time()]); Db::getInstance()->execute('INSERT INTO bank (user_id) VALUES ?', $userId); setcookie(GAMEDOMAIN, $userId, time() + 3600); setcookie("battle", time()); $_SESSION['uid'] = $userId; $_SESSION['sid'] = session_id(); return true; } }; $newUser::addUser($login, $password, $email, $birthday); header('Location: fight.php'); exit; } } Template::header('Регистрация персонажа'); ?> ← на главную

Регистрация