-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathprivate_messages.php
30 lines (25 loc) · 1.14 KB
/
private_messages.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
<?php
// More info about CppComet http://comet-server.org/doku.php/en
// More info about CometQL http://comet-server.org/doku.php/en:comet:cometql
// More info about auth in CppComet http://comet-server.org/doku.php/en:comet:authentication
header('Content-Type: text/html; charset=utf-8');
header("Access-Control-Allow-Origin: *");
// We connect to the comet server with login and password for the access demo (you can get your data for connection after registration at comet-server.com)
// Login 15
// Password lPXBFPqNg3f661JcegBY0N0dPXqUBdHXqj2cHf04PZgLHxT6z55e20ozojvMRvB8
// CometQL_v1 database
$link = mysqli_connect("app.comet-server.ru", "15", "lPXBFPqNg3f661JcegBY0N0dPXqUBdHXqj2cHf04PZgLHxT6z55e20ozojvMRvB8", "CometQL_v1");
$user_id = (int)$_GET['user_id'];
$text = $_GET['text'];
$query = "INSERT INTO users_messages (id, event, message)VALUES('".$user_id."', 'iziMessages', '".mysqli_real_escape_string($link, $text)."');'";
// Отправляем сообщение в канал
mysqli_query ( $link, $query);
echo $query."\n\n";
if(mysqli_errno($link))
{
echo mysqli_errno($link).": ".mysqli_error($link);
}
else
{
echo "ok";
}