25 lines
391 B
PHP
25 lines
391 B
PHP
<?php
|
|
|
|
require_once './db_connection.php';
|
|
|
|
require_once './modules/user.mod.php';
|
|
require_once './modules/chat.mod.php';
|
|
|
|
|
|
$user_id = $_GET['id'];
|
|
$pass = $_GET['pass'];
|
|
$chat_message = $_GET['text'];
|
|
|
|
$user = User :: find ($user_id);
|
|
|
|
if ($user -> pass === $pass)
|
|
{
|
|
$chat = new Chat;
|
|
|
|
$chat -> user_id = $user_id;
|
|
$chat -> text = $chat_message;
|
|
|
|
$chat -> insert ();
|
|
}
|
|
|