blob: ae4e3bbb58ea3aa1780bd67cbcbe19c28dc6d0e7 [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
13 $query = "";
Andreu885889c2019-09-19 00:28:20 +020014 $query2 = "";
Andreuabbcb7e2019-09-21 18:22:14 +020015
16 $victimid = "ANY (SELECT quimata FROM users WHERE id=".(int)$_GET['user_id'].")";
17
18 if ($_GET['msg'] == "REQ KILL") $query = "UPDATE users SET requested=1 WHERE id=".$victimid; // request kill
Andreued491672019-09-20 13:09:18 +020019 if ($_GET['msg'] == "REQ DEAD") $query = "UPDATE users SET requested=2 WHERE quimata=".(int)$_GET['user_id']; // request dead
20 if ($_GET['msg'] == "CONF DEAD") {
21 // User gets killed
Andreuabbcb7e2019-09-21 18:22:14 +020022 $query = "UPDATE users SET requested=0, quimata=".(int)$_GET['user_quimata']." WHERE quimata=".(int)$_GET['user_id']; // assign new victim to killer
Andreued491672019-09-20 13:09:18 +020023 $query2 = "UPDATE users SET quimata=0, mort=1 WHERE id=".(int)$_GET['user_id']; // confirm victim dead/killed
Andreu885889c2019-09-19 00:28:20 +020024 }
Andreued491672019-09-20 13:09:18 +020025 if ($_GET['msg'] == "DENY REQ") $query = "UPDATE users SET requested=0 WHERE id=".(int)$_GET['user_id']; // deny request
Andreuffefd222019-09-19 11:09:44 +020026
Andreu66ad5cf2019-09-18 17:15:44 +020027 // Fetch the information of the user
Andreued491672019-09-20 13:09:18 +020028 if ($query != "" and $result = $conn->query($query)) echo $query;
Andreu57f3ca92019-09-18 19:40:42 +020029 else die("Wrong query: " . $query);
Andreued491672019-09-20 13:09:18 +020030 if ($query2 != "" and $result = $conn->query($query2)) echo "\n" . $query2;
31 else echo "\nNo second query";
Andreu66ad5cf2019-09-18 17:15:44 +020032
33 // Close connection
34 $conn->close();
35?>