From 19b7f2e489c7fa9944f2ee145be5b358f01c1c13 Mon Sep 17 00:00:00 2001 From: lopar Date: Tue, 23 Jun 2020 08:49:36 +0300 Subject: [PATCH] =?UTF-8?q?=D0=98=D0=B7=D0=BC=D0=B5=D0=BD=D0=B8=D0=BB?= =?UTF-8?q?=D0=B8=D1=81=D1=8C=20=D0=BD=D0=B0=D0=B7=D0=B2=D0=B0=D0=BD=D0=B8?= =?UTF-8?q?=D1=8F=20=D0=BF=D0=BE=D0=BB=D0=B5=D0=B9=20=D0=B1=D0=B0=D0=B7?= =?UTF-8?q?=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- enter.php | 2 +- register.php | 18 +++--------------- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/enter.php b/enter.php index ab175f7..a40149e 100644 --- a/enter.php +++ b/enter.php @@ -39,7 +39,7 @@ if ($username && $password) { db::c()->query('INSERT INTO `online` (`id`, `date`, `room`) VALUES (?i, ?i, ?i)', $data['id'], time(), $data['room']); } - db::c()->query('UPDATE `users` SET `sid` = "?s", `enter_game` = ?i WHERE `id` = ?i LIMIT 1', session_id(), 1, $data['id']); + db::c()->query('UPDATE `users` SET `sid` = "?s", `enter_game` = ?i WHERE `id` = ?i', session_id(), 1, $data['id']); $_SESSION['sid'] = session_id(); $sms = db::c()->query('SELECT * FROM `telegraph` WHERE `receiver` = ?i', $data['id']); diff --git a/register.php b/register.php index b1059ff..df93c8e 100644 --- a/register.php +++ b/register.php @@ -22,9 +22,8 @@ if ($hreject) { db::c()->query('INSERT INTO `users` (`login`,`pass`,`email`,`borndate`,`ip`,`sid`) VALUES ("?s", "?s", "?s", "?s", "?s", "?s")', $login, $password, $email, $birthday, $ip, session_id()); $nid = db::c()->getLastInsertId(); - db::c()->query('INSERT INTO `online` (`id`, `date`, `room`) VALUES (?i, ?i, ?i)', $nid, time(), 1); - db::c()->query('INSERT INTO `bank` (`id`) VALUES (?i)', $nid, 5); - //db::c()->query('UPDATE `users` SET `sid` = "?s" WHERE `id` = ?i', session_id(), $nid); + db::c()->query('INSERT INTO `online` (`user_id`, `date`, `room`) VALUES (?i, ?i, ?i)', $nid, time(), 1); + db::c()->query('INSERT INTO `bank` (`user_id`) VALUES (?i)', $nid, 5); setcookie(GAMEDOMAIN, $nid, time() + 3600); setcookie("battle", time()); $_SESSION['uid'] = $nid; @@ -34,20 +33,9 @@ if ($hreject) { } } } -//******************************************************************************************** -// Вот этого куска я не понял. Если что-то пойдёт не так, я буду отталкиваться от него. -//session_start(); -//setcookie("battle", time()); -//$_SESSION['uid'] = $i; -//mysql_query("UPDATE `users` SET `sid` = '" . session_id() . "' WHERE `id` = {$i} LIMIT 1"); -// -//$_SESSION['sid'] = session_id(); -//header("Location: fight.php"); -//die(); -//*********************************************************************************************** ?> - +