Advertisement
Guest User

Untitled

a guest
Jul 10th, 2016
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.29 KB | None | 0 0
  1. <?php
  2. $variable1 = $_POST['var1'];
  3. $variable2 = $_POST['var2'];
  4. $variable3 = $_POST['var3'];
  5. $variable4 = $_POST['var4'];
  6.  
  7.  
  8. $keycodee = $variable3;
  9.  
  10. $hwid = $variable3;
  11. $uname = $variable1;
  12. $passworda = $variable2;
  13.  
  14. $server = "";
  15. $username = "";
  16. $password = "";
  17. $dbname = "";
  18.  
  19.  
  20.  
  21.  
  22.  
  23.  
  24. $pwrd = sha1(strtolower($uname) . $passworda);
  25. // Create connection
  26. $conn = new mysqli($server, $username, $password, $dbname);
  27.  
  28. // Check connection
  29. if ($conn->connect_error) die("Connection failed: " . $conn->connect_error);
  30.  
  31. //Declare SQL statement
  32. $sql = "SELECT Username, Password FROM login WHERE Username= '$uname'";
  33.  
  34. //Catch result
  35. $result = $conn->query($sql);
  36.  
  37. //Check for result
  38. if ($result->num_rows > 0) {
  39.  
  40. // output data of each row
  41. while($row = $result->fetch_assoc()) {
  42.  
  43. $checkuname = $row["Username"];
  44. $checkpwrd = $row["Password"];
  45. $hwiddd = $row["HWIDMAC"];
  46.  
  47. //echo "id: " . $checkgroup. " - Name: " . $checkuname. " " . $checkpwrd . "<br>";
  48. }
  49. }
  50.  
  51. if ($uname == $checkuname && $pwrd == $checkpwrd)
  52. {
  53. echo "1";
  54.  
  55. }
  56. else
  57. {
  58. echo "Pword/Uname is wrong";
  59. }
  60.  
  61. //if ($uname != $checkuname) echo "Your username could not be found";
  62. //if ($pwrd != $checkpwrd) echo "Your password was incorrect";
  63.  
  64.  
  65.  
  66. $conn->close();
  67.  
  68.  
  69.  
  70.  
  71. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement