blob: 131627dcd63a45a283bd0d53785dc2fc8425f688 [file] [log] [blame]
Andreu Huguetfc1e8332020-09-15 18:21:12 +02001<?php
2 require '../credentials.php';
3 require 'utils.php';
Adrià Vilanova Martínez13cf0cd2022-11-20 01:02:20 +01004 require_once("security.php");
Andreu Huguetfc1e8332020-09-15 18:21:12 +02005
Adrià Vilanova Martínez13cf0cd2022-11-20 01:02:20 +01006 $victimid = (int)$_POST["victim-id"];
7 $killerid = (int)$_POST["killer-id"];
8 $msgcontent = mysqli_real_escape_string($conn, $_POST["msg-content"]);
Andreu Huguetfc1e8332020-09-15 18:21:12 +02009
Andreu Huguetd5f9c422020-09-15 18:37:05 +020010 $template = "INSERT INTO `missatges` (`id`, `sender_id`, `receiver_id`, `timestamp`, `content`) VALUES (NULL, $killerid, $victimid, CURRENT_TIMESTAMP, '$msgcontent')";
Andreu Huguetfc1e8332020-09-15 18:21:12 +020011 if (!query($template)) die("An error ocurred." . $template);
12
Adrià Vilanova Martínez13cf0cd2022-11-20 01:02:20 +010013 header("Location: /main.php");
Andreu Huguetfc1e8332020-09-15 18:21:12 +020014?>