blob: 4995ac44269ad17af53933bdec12032b7fc5ae41 [file] [log] [blame]
Andreudca79f42019-09-18 23:53:19 +02001<?php
2 // Get the id
3 $id = $_GET['id'];
4
5 // Define MySQL login variables
6 $servername = "localhost"; // "fdb22.awardspace.net";
7 $username = "root"; // "3155560_users";
8 $password = ""; // "btechnoro@fox4news.info";
9
10 // Create connection
11 $conn = new mysqli($servername, $username, $password, "pastanaga");
12 if ($conn->connect_error) die("Connection failed: " . $conn->connect_error);
13 $conn->set_charset("utf8");
14
15 // Do the query
16 $query = "SELECT requested FROM users WHERE id=".$id;
17 $state = 0;
18
19 // Fetch the information of the user
20 if ($result = $conn->query($query)) {
21 while ($row = $result->fetch_row()) $state = $row[0];
22 $result->close();
23 } else {
24 die("Wrong query: " . $query);
25 }
26
27 // Close connection
28 $conn->close();
29
30 // Print the state
31 echo $state;
32?>