-
Notifications
You must be signed in to change notification settings - Fork 9
/
ajax_login_check.php
31 lines (30 loc) · 991 Bytes
/
ajax_login_check.php
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
<?
// ===================================================================
// Sim Roulette -> AJAX
// License: GPL v3 (https://www.gnu.org/licenses/gpl.html)
// Copyright (c) 2016-2022 Xzero Systems, https://sim-roulette.com
// Author: Nikita Zabelin
// ===================================================================
include("_func.php");
$_GET['login']=trim($_GET['login']);
if (strlen(trim($_GET['login']))<8){echo '1'; exit();}
if (strlen(trim($_GET['login']))>32){echo '1'; exit();}
if (!preg_match('/^[A-Za-z0-9_-]{6,32}$/i',$_GET['login'])){echo '1'; exit();}
$qry="SELECT * FROM `a_users` WHERE `login` LIKE '".mysqli_real_escape_string($db,$_GET['login'])."'";
if ($result = mysqli_query($db, $qry))
{
if ($row = mysqli_fetch_assoc($result))
{
echo '1';
exit();
}
}
$qry="SELECT * FROM `staff` WHERE `login` LIKE '".mysqli_real_escape_string($db,$_GET['login'])."'";
if ($result = mysqli_query($db, $qry))
{
if ($row = mysqli_fetch_assoc($result))
{
echo '1';
}
}
?>