blob: 1a34cdf4430448894e548a0ec957c66e3d1cb0b5 [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 = "";
Andreued491672019-09-20 13:09:18 +020015 if ($_GET['msg'] == "REQ KILL") $query = "UPDATE users SET requested=1 WHERE id=".(int)$_GET['victim_id']; // request kill
16 if ($_GET['msg'] == "REQ DEAD") $query = "UPDATE users SET requested=2 WHERE quimata=".(int)$_GET['user_id']; // request dead
17 if ($_GET['msg'] == "CONF DEAD") {
18 // User gets killed
19 $query = "UPDATE users SET requested=0, quimata=".(int)$_GET['user_quimata']." WHERE quimata=".$_GET['user_id']; // assign new victim to killer
20 $query2 = "UPDATE users SET quimata=0, mort=1 WHERE id=".(int)$_GET['user_id']; // confirm victim dead/killed
Andreu885889c2019-09-19 00:28:20 +020021 }
Andreued491672019-09-20 13:09:18 +020022 if ($_GET['msg'] == "CONF KILL") {
23 // Victim gets killed
24 $query = "UPDATE users SET requested=0, quimata=".(int)$_GET['victim_quimata']." WHERE quimata=".$_GET['victim_id']; // assign new victim to killer
25 $query2 = "UPDATE users SET quimata=0, mort=1 WHERE id=".(int)$_GET['victim_id']; // confirm victim dead/killed
26 }
27 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 +020028
Andreu66ad5cf2019-09-18 17:15:44 +020029 // Fetch the information of the user
Andreued491672019-09-20 13:09:18 +020030 if ($query != "" and $result = $conn->query($query)) echo $query;
Andreu57f3ca92019-09-18 19:40:42 +020031 else die("Wrong query: " . $query);
Andreued491672019-09-20 13:09:18 +020032 if ($query2 != "" and $result = $conn->query($query2)) echo "\n" . $query2;
33 else echo "\nNo second query";
Andreu66ad5cf2019-09-18 17:15:44 +020034
35 // Close connection
36 $conn->close();
37?>