Andreu Huguet | fc1e833 | 2020-09-15 18:21:12 +0200 | [diff] [blame] | 1 | <?php |
| 2 | require '../credentials.php'; |
| 3 | require 'utils.php'; |
Adrià Vilanova Martínez | 13cf0cd | 2022-11-20 01:02:20 +0100 | [diff] [blame] | 4 | require_once("security.php"); |
Andreu Huguet | fc1e833 | 2020-09-15 18:21:12 +0200 | [diff] [blame] | 5 | |
Adrià Vilanova Martínez | 13cf0cd | 2022-11-20 01:02:20 +0100 | [diff] [blame] | 6 | $victimid = (int)$_POST["victim-id"]; |
| 7 | $killerid = (int)$_POST["killer-id"]; |
| 8 | $msgcontent = mysqli_real_escape_string($conn, $_POST["msg-content"]); |
Andreu Huguet | fc1e833 | 2020-09-15 18:21:12 +0200 | [diff] [blame] | 9 | |
Andreu Huguet | d5f9c42 | 2020-09-15 18:37:05 +0200 | [diff] [blame] | 10 | $template = "INSERT INTO `missatges` (`id`, `sender_id`, `receiver_id`, `timestamp`, `content`) VALUES (NULL, $killerid, $victimid, CURRENT_TIMESTAMP, '$msgcontent')"; |
Andreu Huguet | fc1e833 | 2020-09-15 18:21:12 +0200 | [diff] [blame] | 11 | if (!query($template)) die("An error ocurred." . $template); |
| 12 | |
Adrià Vilanova Martínez | 13cf0cd | 2022-11-20 01:02:20 +0100 | [diff] [blame] | 13 | header("Location: /main.php"); |
Andreu Huguet | fc1e833 | 2020-09-15 18:21:12 +0200 | [diff] [blame] | 14 | ?> |