· 8 years ago · Dec 26, 2017, 08:12 PM
1$connection = new mysqli($config["servername"], $config["username"],
2$config["password"], $config["dbname"]);
3if($connection->connect_errno)
4{
5 die("Echec lors de la connexion à MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error);
6}
7
8if(!empty($username) and !empty($password) and !empty($secure))
9{
10if($secure != $secretkey)
11{
12 echo "Secured! File!";
13 goto end;
14}
15
16if($stmtCheckCo = $connection->prepare("SELECT id,firstname,lastname,country,username,age,email from users where username=? and password=?"))
17{
18 $stmtCheckCo->bind_param("ss", $username, $hashedpassword);
19
20 if($stmtCheckCo->execute())
21 {
22 echo $username . " & " . $hashedpassword;
23 /*
24 $result = $stmtCheckCo->get_result();
25
26 $getInfo = array();
27 while ($row = $result->fecth_assoc()) {
28 $getInfo[] = $row;
29 }
30 */
31
32 $getNumAccount = $stmtCheckCo->num_rows;
33 }
34
35 $stmtCheckCo->close();
36}
37
38$connection = new mysqli($config["servername"], $config["username"],
39$config["password"], $config["dbname"]);
40if($connection->connect_errno)
41{
42die("Echec lors de la connexion à MySQL: (" . $mysqli->connect_errno . ") " . $mysqli->connect_error);
43}
44
45if(!empty($mac))
46{
47if($secure != $secretkey)
48{
49 echo"Secured! File";
50 goto end;
51}
52
53if($stmtcheckMAC = $connection->prepare("SELECT * FROM users WHERE macAddresses=?"))
54{
55 $stmtcheckMAC->bind_param("s", $mac);
56
57 if(!$stmtcheckMAC->execute())
58 {
59 echo $stmtcheckMAC->error;
60 }
61
62 $resultcheckMAC = $stmtcheckMAC->get_result();
63
64 $stuts = $stmtcheckMAC->num_rows;
65
66 if($stuts > 0 )
67 {
68 $allUsers = array();
69 while ($row = $resultcheckMAC->fecth_assoc())
70 {
71 $allUsers[] = $row;
72 if($allUsers["banned"]==1)
73 {
74 echo"2";
75 goto end;
76 }
77 }
78 echo "1"; // if user is exist and he not got banned
79
80 }
81 else
82 {
83 echo "3"; // optional this check if you want disable user have multi account 3 mean new user
84 }
85}
86}
87else if(@$oip)
88{
89 if($stmtcheckMAC = $connection->prepare("SELECT * FROM users WHERE ip=?"))
90 {
91 $stmtcheckMAC->bind_param("s", $ip);
92
93 if(!$stmtcheckMAC->execute())
94 {
95 echo $stmtcheckMAC->error;
96 }
97
98 $resultcheckMAC = $stmtcheckMAC->get_result();
99
100 $stuts = $stmtcheckMAC->num_rows;
101
102 if($stuts > 0 )
103 {
104 $allUsers = array();
105 while ($row = $resultcheckMAC->fecth_assoc())
106 {
107 $allUsers[] = $row;
108 if($allUsers["banned"]==1)
109 {
110 echo"2";
111 goto end;
112 }
113 }
114 echo "1"; // if user is exist and he not got banned
115
116 }
117 else
118 {
119 echo "3"; // optional this check if you want disable user have multi account 3 mean new user
120 }
121}
122}
123else
124{
125 echo "Empty";
126}