blob: 5e0384395131e52f24d7132e01f832bf06b773ae [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ínez60524332022-11-20 02:33:56 +01006 // Yup, this is a f*ature, not a b*g. Please be responsible when exploit*ng this :) Have fun with it, but please don't cross the line!
Adrià Vilanova Martínez13cf0cd2022-11-20 01:02:20 +01007 $victimid = (int)$_POST["victim-id"];
8 $killerid = (int)$_POST["killer-id"];
9 $msgcontent = mysqli_real_escape_string($conn, $_POST["msg-content"]);
Andreu Huguetfc1e8332020-09-15 18:21:12 +020010
Andreu Huguetd5f9c422020-09-15 18:37:05 +020011 $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 +020012 if (!query($template)) die("An error ocurred." . $template);
13
Adrià Vilanova Martínez13cf0cd2022-11-20 01:02:20 +010014 header("Location: /main.php");
Andreu Huguetfc1e8332020-09-15 18:21:12 +020015?>