Guest User

Untitled

a guest
Dec 10th, 2017
38
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.79 KB | None | 0 0
  1. <?php
  2. ini_set('display_errors', 1);
  3. ini_set('display_startup_errors', 1);
  4. error_reporting(E_ALL);
  5.  
  6. printf("Siema");
  7. $link = mysqli_connect("localhost", "root", "root", "instytut");
  8. if (!$link) {
  9. printf("Connect failed: %s\n", mysqli_connect_error());
  10. exit();
  11. }
  12.  
  13. $username = $_POST['username'];
  14. $password = $_POST['password'];
  15. $create = in_array('create_account', $_POST);
  16. printf("%s, %s, %s", $username, $password, $create);
  17. /*
  18. $login_query = sprintf("SELECT pass_hash from User WHERE username='%s', $username);
  19.  
  20. $result = mysqli_query($link,$login_query);
  21.  
  22. if (!$result) {
  23. printf("Query failed: %s\n", mysqli_error($link));
  24. //exit(1);
  25. }
  26. if (mysqli_num_rows($result) == 0){
  27. printf("Username not found");
  28. //exit(2);
  29. }
  30. print("%s", $result);
  31. */
  32.  
  33. ?>
Add Comment
Please, Sign In to add comment