forked from mario-fan-games-galaxy/tcsms
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathdiscorduser.php
More file actions
75 lines (53 loc) · 1.39 KB
/
discorduser.php
File metadata and controls
75 lines (53 loc) · 1.39 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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<?php
//INIT
//------------------------------------------------
//Mainframe
error_reporting(E_ALL);
set_time_limit(0);
define ('ROOT_PATH', './');
global $upload_msg, $global_error;
require ROOT_PATH.'settings.php';
require ROOT_PATH.'lib/db_drivers/'.$CFG['db_driver'].'.php';
$DB = new db_driver;
$DB->connect();
if (!empty($_GET['debug']))
$DB->debug = 1;
require ROOT_PATH.'lib/std.php';
require ROOT_PATH.'lib/userlib.php';
require ROOT_PATH.'lib/module.php';
require ROOT_PATH.'component/template_ui.php';
global $IN, $STD, $DB, $CFG;
require_once ROOT_PATH.'lib/resource.php';
require_once ROOT_PATH.'lib/message.php';
//------------------------------------------------
//variables
$debug_user = '';
$count = 0;
$input_discord = '';
$input_username = null;
if (!empty($_GET['dis']))
{
$input_discord = urldecode($_GET['dis']);
}
if (!empty($_GET['name']))
{
$input_username = urldecode($_GET['name']);
}
$where = $DB->format_db_where_string(array('discord' => $input_discord),
array('username' => $input_username));
$DB->query("SELECT username, discord FROM ".$CFG['db_pfx']."_users WHERE ".$where);
$count = intval($DB->get_num_rows());
while ($row = $DB->fetch_row())
{
$db_user = $row['username'];
}
if ($count <> 0)
{
echo "yes";
}
else
{
echo $where.'<br>'.'Username = '.$input_username.'<br>'.'Discord = '.$input_discord.'<br>'.'Count = '.$count;
}
$DB->close_db();
?>