Andreu | 66ad5cf | 2019-09-18 17:15:44 +0200 | [diff] [blame] | 1 | <?php |
| 2 | // Define MySQL login variables |
| 3 | $servername = "fdb22.awardspace.net"; |
| 4 | $username = "3155560_users"; |
| 5 | $password = "btechnoro@fox4news.info"; |
| 6 | |
| 7 | // Create connection |
| 8 | $conn = new mysqli($servername, $username, $password, "3155560_users"); |
| 9 | if ($conn->connect_error) die("Connection failed: " . $conn->connect_error); |
| 10 | $conn->set_charset("utf8"); |
| 11 | |
| 12 | // Do the query |
| 13 | $query = ""; |
| 14 | if ($_GET['msg'] == 1) $query = "UPDATE users SET requested=".$_GET['msg']." WHERE id=".$_GET['id']; // request kill |
| 15 | if ($_GET['msg'] == 2) $query = "UPDATE users SET requested=".$_GET['msg']." WHERE quimata=".$_GET['id']; // request dead |
| 16 | if ($_GET['msg'] == 3) $query = "UPDATE users SET mort=1 WHERE id=".$_GET['id']; // confirm dead |
| 17 | if ($_GET['msg'] == 4) $query = "UPDATE users SET mort=1 WHERE quimata=".$_GET['id']; // confirm killed |
Andreu | 57f3ca9 | 2019-09-18 19:40:42 +0200 | [diff] [blame^] | 18 | if ($_GET['msg'] == 5) $query = "UPDATE users SET requested=0 WHERE id=".$_GET['id']; // deny request |
Andreu | 66ad5cf | 2019-09-18 17:15:44 +0200 | [diff] [blame] | 19 | |
| 20 | // Fetch the information of the user |
Andreu | 57f3ca9 | 2019-09-18 19:40:42 +0200 | [diff] [blame^] | 21 | if ($result = $conn->query($query)) echo 'Success!'; |
| 22 | else die("Wrong query: " . $query); |
Andreu | 66ad5cf | 2019-09-18 17:15:44 +0200 | [diff] [blame] | 23 | |
| 24 | // Close connection |
| 25 | $conn->close(); |
| 26 | ?> |