-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpoll.php
More file actions
executable file
·51 lines (43 loc) · 1.13 KB
/
poll.php
File metadata and controls
executable file
·51 lines (43 loc) · 1.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<?php
$uuid = $_GET["x"];
$servername = "site-db";
$username = "game_user";
$password = "5DtNfLKdPdU1y6AL";
$db_name = "goaskme_game";
// Create connection
$conn = new mysqli($servername, $username, $password, $db_name);
// Check connection
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
}
$stmt = $conn->prepare("SELECT uuID, account, myTimestamp, ref, sign FROM game_login WHERE uuID = ?");
$stmt->bind_param("s", $uuid);
$stmt->execute();
$res = $stmt->get_result();
$row = $res->fetch_array(MYSQLI_ASSOC);
if($row != NULL){
$str = json_encode($row);
echo $str;
}else{
echo "";
}
$stmt->close();
$conn->close();
// $myfile = fopen("data.txt","w+");
// fwrite($myfile,$input);
// fclose($myfile);
// file_put_contents("data.txt", $input);
// $contents = file_get_contents("data.txt");
// $myObj = new stdClass();
// if(strcmp($contents, "") != 0){
// $myObj->code = 0;
// $myObj->error = "successful";
// $myJSON = json_encode($myObj);
// echo $myJSON;
// }else{
// $myObj->code = 1;
// $myObj->error = "Failed";
// $myJSON = json_encode($myObj);
// echo $myJSON;
// }
?>