Advertisement
Guest User

Untitled

a guest
Oct 5th, 2016
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.78 KB | None | 0 0
  1. <?php
  2. $resultString = "yey";
  3. $loggedIn = 0;
  4. $servername = "mysql7.000webhost.com";
  5. $username = "a8305444_hexus";
  6. $password = "h107d321";
  7. $dbname = "a8305444_hexus";
  8.  
  9. if (isset($_GET["username"])) {
  10. if (isset($_GET["password"])) {
  11. $myUsername = $_GET["username"];
  12. $myPassword = $_GET["password"];
  13. $conn = new mysqli($servername, $username, $password, $dbname);
  14. if ($conn->connect_error) {
  15. die("errnoconnect");
  16. }
  17.  
  18. $sql = "SELECT * FROM users";
  19. $result = $conn->query($sql);
  20.  
  21. if ($result->num_rows > 0) {
  22. while($row = $result->fetch_assoc()) {
  23. if ($row["username"] == $myUsername) {
  24. if ($row["password"] == $myPassword) {
  25. die($resultString);
  26. }
  27. }
  28. }
  29. }
  30. die("err");
  31. $conn->close();
  32. }
  33. }
  34. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement