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