| @@ -0,0 +1,24 @@ | |||||
| #module \ | |||||
| Chat | |||||
| #define URL ("http://miteruzo.ml/goatoh_training/chat.php") | |||||
| #defcfunc \ | |||||
| New \ | |||||
| int p_id | |||||
| id.insNum = p_id | |||||
| insNum++ | |||||
| Return insNum - 1 | |||||
| #deffunc \ | |||||
| Send \ | |||||
| str p_message | |||||
| int p_insId | |||||
| HTTPLoad URL, StrF ("id=%d&text=%s", id.p_insId, p_message) | |||||
| Return | |||||
| #global | |||||
| @@ -2,3 +2,11 @@ | |||||
| require_once './modules/common.mod.php'; | require_once './modules/common.mod.php'; | ||||
| $db = new Chat; | |||||
| $user_id = $_POST['id']; | |||||
| $chat_message = $_POST['text']; | |||||
| $db -> send_chat ($user_id, $chat_message); | |||||
| @@ -20,7 +20,7 @@ Chat | |||||
| } | } | ||||
| function | function | ||||
| sendChat ( | |||||
| send_chat ( | |||||
| int $user_id, | int $user_id, | ||||
| string $text): | string $text): | ||||
| void | void | ||||