Browse Source

changed name

main
Miteruzo 1 year ago
parent
commit
68f1e353ee
2 changed files with 7 additions and 6 deletions
  1. +3
    -3
      chat.php
  2. +4
    -3
      modules/chat.mod.php

+ 3
- 3
chat.php View File

@@ -1,12 +1,12 @@
<?php

require_once './modules/common.mod.php';
require_once './modules/chat.mod.php';


$db = new Chat;
$chat = new Chat;

$user_id = $_POST['id'];
$chat_message = $_POST['text'];

$db -> send_chat ($user_id, $chat_message);
$chat -> send ($user_id, $chat_message);


+ 4
- 3
modules/chat.mod.php View File

@@ -3,10 +3,11 @@
class
Chat
{
var $db;
private $db;

function
__construct ()
__construct ():
void
{
$config = include (__DIR__ . '/config.php');

@@ -28,7 +29,7 @@ Chat
$sql = "
INSERT INTO
chats (
id,
user_id,
text)
VALUES
(


Loading…
Cancel
Save