query('SELECT 1 FROM `users` WHERE `login` = "?s" OR `email` = "?s"', $login, $email)->getNumRows(); if ($check > 0) { $error = "В системе уже есть такие данные!"; } else { db::c()->query('INSERT INTO users (login,pass,email,borndate,ip,session_id) VALUES ("?s", "?s", "?s", "?s", "?s", "?s")', $login, $password, $email, $birthday, $ip, session_id()); $nid = db::c()->getLastInsertId(); db::c()->query('INSERT INTO `online` (user_id, date, room, real_time) VALUES (?i, ?i, ?i, ?i)', $nid, time(), 1, time()); db::c()->query('INSERT INTO `bank` (`user_id`) VALUES (?i)', $nid, 5); setcookie(GAMEDOMAIN, $nid, time() + 3600); setcookie("battle", time()); $_SESSION['uid'] = $nid; $_SESSION['sid'] = session_id(); header('Location: fight.php'); exit; } } } \Battles\Template::header('Регистрация персонажа'); ?> ← на главную

Регистрация