Advertisement
Guest User

dll file

a guest
Jan 21st, 2019
139
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 1.69 KB | None | 0 0
  1. <?php
  2. $link = mysqli_connect('host', 'user', 'pass'); //host, user, pass
  3.  
  4. $database = mysqli_select_db($link, "reptilec_db"); //Set here your db name
  5.  
  6. $user = $_GET['username'];
  7. $password = $_GET['password'];
  8. $hwid = $_GET['hwid'];
  9.  
  10. $tables = "user"; //Set here ur user table
  11. $sql = "SELECT * FROM ". $tables ." WHERE username = '". mysqli_real_escape_string($link,$user) ."'" ;
  12. $result = $link->query($sql);
  13.  
  14. if ($result->num_rows > 0) {
  15.     // Outputting the rows
  16.     while($row = $result->fetch_assoc())
  17.     {
  18.        
  19.         $password = $row['password'];
  20.  
  21.         $sql_pass = $_GET['password'];
  22.        
  23.         function Redirect($url, $permanent = false)
  24.         {
  25.             if (headers_sent() === false)
  26.             {
  27.                 header('Location: ' . $url, true, ($permanent === true) ? 301 : 302);
  28.             }
  29.         exit();
  30.         }
  31.        
  32.         if($sql_pass != $row['password'])
  33.         {
  34.             echo "0"; // pass is wrong
  35.         }
  36.         else
  37.         {
  38.             echo "1"; // pass is correct
  39.         }
  40.        
  41.         if (strlen($row['hwid']) > 1)
  42.         {
  43.             if ($hwid != $row['hwid'])
  44.             {
  45.                 echo "2"; // hwid is wrong
  46.             }
  47.             else
  48.             {
  49.                 echo "1"; // hwid is correct
  50.             }
  51.         }
  52.         else
  53.         {
  54.             $sql = "UPDATE ". $tables ." SET hwid='$hwid' WHERE username='$user'";
  55.             if(mysqli_query($link, $sql))
  56.             {
  57.                 echo $row['hwid'];
  58.                 echo "3"; // sets hwid
  59.             }
  60.             else
  61.             {
  62.                 echo "4"; // rest of errors
  63.             }
  64.         }
  65.     }
  66. }  
  67. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement