From 32ce7ad7e4b993eb3dc6e6ad47d61092282dc6cb Mon Sep 17 00:00:00 2001 From: "Igor Barkov (iwork)" Date: Wed, 30 Sep 2020 17:15:13 +0300 Subject: [PATCH] =?UTF-8?q?=D0=92=D0=BD=D0=B5=D0=B4=D1=80=D0=B5=D0=BD?= =?UTF-8?q?=D0=B8=D0=B5=20=D1=88=D0=B0=D0=B1=D0=BB=D0=BE=D0=BD=D0=B8=D0=B7?= =?UTF-8?q?=D0=B0=D1=82=D0=BE=D1=80=D0=B0.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- chat.php | 47 ++++++++++++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/chat.php b/chat.php index 2e906b9..746983f 100644 --- a/chat.php +++ b/chat.php @@ -11,13 +11,13 @@ if (empty($_SESSION['uid'])) { exit; } require_once "config.php"; -//include_once "functions.php"; $msg = $_POST['msg'] ?? null; -$uid = $_SESSION['uid']; +$uid = $_SESSION['uid'] ?? null; if ($msg) { - try { db::c()->query('INSERT INTO `chat` (`user_id`, `msg`) VALUES (?i, "?s")', $uid, $msg); } - catch (\Krugozor\Database\Mysql\Exception $e) { + try { + db::c()->query('INSERT INTO `chat` (`user_id`, `msg`) VALUES (?i, "?s")', $uid, $msg); + } catch (\Krugozor\Database\Mysql\Exception $e) { echo "
Ошибка: " . $e->getMessage() . "
В файле: " . $e->getFile() . " (" . $e->getLine() . ")
"; } } @@ -50,24 +50,33 @@ function show_messages() show_messages(); +Template::header('chat'); ?> - - - - - - - - +
- +
-
- \ No newline at end of file + \ No newline at end of file