Advertisement
Guest User

Untitled

a guest
May 30th, 2015
240
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. <?php
  2. //Idee von Jan über ssh2 die ip von eluten die zu viele male anfragen in den ip-tables sperren
  3. include('config.php');
  4.  
  5. $key = $_GET['key'];
  6. //Parameter der API
  7. $username = $_GET['username'];
  8. //suche nach der Antwort
  9. $uuid = file_get_contents("http://mcuuid.com/api/$username/raw");
  10.  
  11. $db = new mysqli($mysql_ip, $mysql_username, $mysql_pass, $mysql_database);
  12.  
  13. if ($db->connect_errno) {
  14. printf("Connect failed: %s\n", $db->connect_error);
  15. exit();
  16. }
  17.  
  18. if ($result = $db->query("SELECT * FROM test WHERE $key")) {
  19. $row = $result->fetch_array(MYSQLI_ASSOC);
  20.  
  21. $active = $row['active'];
  22. $banned = $row['banned'];
  23.  
  24. if((int)$banned == 0){
  25. if((int)$active == 1){
  26.  
  27. if(strlen($key) < 9){
  28. die("Invalid key! Contact the support for further information.");
  29. }
  30.  
  31. //Hier startet die Funktion der API
  32. if ($uuid == "Bad request"){
  33. echo "User not found";
  34. } else {
  35. echo "$uuid";
  36. }
  37. //Bis hier ist die Funktion der API
  38. }} else {
  39. die("Invalid key! Contact the support for further information.");
  40. }
  41.  
  42.  
  43. $result->close();
  44. } else {
  45. die("Invalid key! Contact the support for further information.");
  46. }
  47.  
  48. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement