Advertisement
Guest User

Untitled

a guest
Nov 8th, 2017
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.27 KB | None | 0 0
  1. <?php
  2. $servername = "localhost";
  3. $username = "id3513529_admin";
  4. $password = "abc123";
  5. $dbname = "id3513529_data1";
  6. $worldpass = "testpass1";
  7.  
  8. $conn = new mysqli($servername, $username, $password, $dbname);
  9.  
  10. $found = 0;
  11. $out = "error";
  12.  
  13. if(base64_decode($_GET["arg"]) == $worldpass)
  14. {
  15.     $requestuuid = $_GET["key"];
  16.     $sql = "SELECT uuid FROM VoxValues";
  17.     $result = $conn->query($sql);
  18.     while($dump = $result->fetch_assoc())
  19.     {
  20.         if($dump["uuid"] == $requestuuid)
  21.         {
  22.             $found = 1;
  23.         }
  24.     }
  25.  
  26.     if($found == 1)
  27.     {
  28.         $sql = "SELECT 'denarii', 'honor' FROM 'VoxValues' WHERE uuid='".$requestuuid."'";
  29.         $result = $conn->query($sql);
  30.         while($dump = $result->fetch_assoc())
  31.         {
  32.             $out = "0:denarii:".$dump["denarii"].":".$dump["honor"];
  33.         }
  34.     }
  35.  
  36.     if($found == 0)
  37.     {
  38.         $sql = "INSERT INTO `VoxValues` (`uuid`, `denarii`, `honor`, `url`, `joined`) VALUES ('".$requestuuid."', '0', '0', '".$_GET["end"]."', CURRENT_TIMESTAMP)";
  39.         $result = mysqli_query($conn,$sql);
  40.         if($result == TRUE)
  41.         {
  42.             $out = "1:denarii:0:honor:0";
  43.         }
  44.  
  45.         else $out = "error99";
  46.     }
  47. }
  48.  
  49. else $out = "error2";
  50.  
  51. echo $out;
  52. if($conn)$conn->close();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement