blob: 7ef87ab58ebc9e9421113bffcdd47a19e4c7b3f5 [file] [log] [blame]
Andreu66ad5cf2019-09-18 17:15:44 +02001<?php
2 // Define MySQL login variables
Andreued8e1f92019-09-18 22:26:04 +02003 $servername = "localhost"; // "fdb22.awardspace.net";
4 $username = "root"; // "3155560_users";
5 $password = ""; // "btechnoro@fox4news.info";
Andreu66ad5cf2019-09-18 17:15:44 +02006
7 // Create connection
Andreued8e1f92019-09-18 22:26:04 +02008 $conn = new mysqli($servername, $username, $password, "pastanaga");
Andreu66ad5cf2019-09-18 17:15:44 +02009 if ($conn->connect_error) die("Connection failed: " . $conn->connect_error);
10 $conn->set_charset("utf8");
11
12 // Do the query
Andreuefe66eb2019-09-21 18:41:49 +020013 $queries = [""];
Andreuabbcb7e2019-09-21 18:22:14 +020014
15 $victimid = "ANY (SELECT quimata FROM users WHERE id=".(int)$_GET['user_id'].")";
16
Andreuefe66eb2019-09-21 18:41:49 +020017 if ($_GET['msg'] == "REQ KILL") $queries = ["UPDATE users SET requested=1 WHERE id=".$victimid]; // request kill
18 if ($_GET['msg'] == "REQ DEAD") $queries = ["UPDATE users SET requested=2 WHERE quimata=".(int)$_GET['user_id']]; // request dead
19 if ($_GET['msg'] == "DENY REQ") $queries = ["UPDATE users SET requested=0 WHERE id=".(int)$_GET['user_id']]; // deny request
Andreued491672019-09-20 13:09:18 +020020 if ($_GET['msg'] == "CONF DEAD") {
Andreuefe66eb2019-09-21 18:41:49 +020021 $queries = ["UPDATE users SET requested=0, quimata=".(int)$_GET['user_quimata']." WHERE quimata=".(int)$_GET['user_id'], // assign new victim to killer
22 "UPDATE users SET quimata=0, mort=1 WHERE id=".(int)$_GET['user_id']]; // confirm victim dead/killed
Andreu885889c2019-09-19 00:28:20 +020023 }
Andreu66ad5cf2019-09-18 17:15:44 +020024 // Fetch the information of the user
Andreuefe66eb2019-09-21 18:41:49 +020025 foreach ($queries as $query) {
26 if ($query != "" and $result = $conn->query($query)) echo $query;
27 else die("Wrong query: " . $query);
28 }
29
Andreu66ad5cf2019-09-18 17:15:44 +020030 // Close connection
31 $conn->close();
32?>