Advertisement
Guest User

Untitled

a guest
Aug 20th, 2017
313
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. <?
  2. $servername = "localhost";
  3. $username = "tremorse_apa";
  4. $password = "apa123";
  5. $dbname = "tremorse_test";
  6.  
  7. // Create connection
  8. $conn = new mysqli($servername, $username, $password, $dbname);
  9. // Check connection
  10. if ($conn->connect_error) {
  11. die("Connection failed: " . $conn->connect_error);
  12. }
  13.  
  14. $sql = "select password from users where name = '" . $_GET['name'] . "' and password='" . $_GET['pass'] . "'";
  15. $result = $conn->query($sql);
  16.  
  17. if ($result->num_rows > 0) {
  18. // output data of each row
  19. while($row = $result->fetch_assoc()) {
  20. echo "ok";
  21.  
  22. // Lagra datat
  23.  
  24.  
  25. }
  26. } else {
  27. echo "error";
  28. }
  29. $conn->close();
  30.  
  31.  
  32. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement