From 7fe8318472c2e705654025866a20f42278f66000 Mon Sep 17 00:00:00 2001 From: lopar Date: Tue, 27 Oct 2020 21:51:49 +0200 Subject: [PATCH 1/2] =?UTF-8?q?=D0=A3=20=D0=B0=D0=BD=D0=BA=D0=B5=D1=82?= =?UTF-8?q?=D1=8B=20=D0=B1=D1=8B=D0=BB=D0=BE=20=D0=BE=D1=82=D0=B4=D0=B5?= =?UTF-8?q?=D0=BB=D1=8C=D0=BD=D0=BE=D0=B5=20=D0=BF=D0=BE=D0=B4=D0=BA=D0=BB?= =?UTF-8?q?=D1=8E=D1=87=D0=B5=D0=BD=D0=B8=D0=B5=20=D0=BA=20=D0=91=D0=94.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- user_anketa.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/user_anketa.php b/user_anketa.php index b687c9d..039939b 100644 --- a/user_anketa.php +++ b/user_anketa.php @@ -10,11 +10,6 @@ if ($user->battle) { exit(); } -use Krugozor\Database\Mysql\Mysql as Mysql; -$db = Mysql::create("192.168.20.100", "battles", "bottle-neck-horse") - ->setDatabaseName("battles") - ->setCharset("utf8"); - define('INFO_CHAR_LIMIT', 1500); $name = filter_input(INPUT_POST, 'name', FILTER_SANITIZE_STRING); $oldpsw = filter_input(INPUT_POST, 'oldpsw', FILTER_SANITIZE_SPECIAL_CHARS); @@ -42,7 +37,7 @@ if ($name || $color || $hobbie) { err('Максимальная длинна поля Хобби: ' . INFO_CHAR_LIMIT . ' символов!'); } else { $values = ['realname' => $name, 'color' => $color, 'info' => $hobbie]; - $db->query('UPDATE users SET ?As WHERE id = ?i', $values, $user->id); + db::c()->query('UPDATE users SET ?As WHERE id = ?i', $values, $user->id); } } -- 2.45.2 From fe834372f23d00481dbec7aec211ff5639431ad1 Mon Sep 17 00:00:00 2001 From: lopar Date: Tue, 27 Oct 2020 21:55:51 +0200 Subject: [PATCH 2/2] =?UTF-8?q?=D0=A0=D0=B5=D0=B3=D0=B8=D1=81=D1=82=D1=80?= =?UTF-8?q?=D0=B0=D1=86=D0=B8=D1=8F=20=D1=81=D0=BB=D0=BE=D0=BC=D0=B0=D0=BB?= =?UTF-8?q?=D0=B0=D1=81=D1=8C.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- enter.php | 2 +- register.php | 44 +++++++++++++++++++++++--------------------- 2 files changed, 24 insertions(+), 22 deletions(-) diff --git a/enter.php b/enter.php index 327d786..be2622a 100644 --- a/enter.php +++ b/enter.php @@ -39,7 +39,7 @@ if ($username && $password) { if (isset($onl['user_id'])) { db::c()->query('UPDATE online SET date = ?i WHERE user_id = "?s"', time(), $user_query['id']); } else { - db::c()->query('INSERT INTO online (user_id, date, room) VALUES (?i, ?i, ?i)', $user_query['id'], time(), $user_query['room']); + db::c()->query('INSERT INTO online (user_id, date, room, real_time) VALUES (?i, ?i, ?i, ?i)', $user_query['id'], time(), $user_query['room'], time()); } db::c()->query('UPDATE `users` SET `session_id` = "?s", `enter_game` = ?i WHERE `id` = ?i', session_id(), 1, $user_query['id']); diff --git a/register.php b/register.php index e0907f7..b427880 100644 --- a/register.php +++ b/register.php @@ -1,12 +1,13 @@ 0) { $error = "В системе уже есть такие данные!"; } else { - db::c()->query('INSERT INTO `users` (`login`,`pass`,`email`,`borndate`,`ip`,`sid`) + 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`) VALUES (?i, ?i, ?i)', $nid, time(), 1); + 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()); @@ -34,19 +35,20 @@ if ($hreject) { } Template::header('Регистрация персонажа'); ?> - ← на главную - -

+ ← на главную + +

-

Регистрация

-
-
-
-
-
-
-
-
- -
+

Регистрация

+
+
+
+
+
+
+
+
+ +
\ No newline at end of file -- 2.45.2