connect_error) { die("Connection failed: " . $conn->connect_error); } if(!empty($_GET['username']) && !empty($_GET['password'])) { $username=mysqli_real_escape_string($conn,$_GET['username']); $password=mysqli_real_escape_string($conn,$_GET['password']); if (preg_match("/admin/i",$username) && $_SERVER['REMOTE_ADDR']!=="127.0.0.1") { die("Admins login are allowed locally only"); } else { $res=$conn->query("select * from users where username='$username' and password='$password'"); # admin admin if($res->num_rows > 0) { $user=$res->fetch_assoc(); echo ($user['username']==="admin")?"0xL4ugh{test_flag}":"sorry u r not admin"; } else { echo "Error : Wrong Creds"; } } } else { echo "Please Fill All Fields"; } ?>