Advertisement
Guest User

pracka

a guest
Oct 14th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.13 KB | None | 0 0
  1. <!doctype html>
  2. <html>
  3. <head>
  4. <title>poprawka</title>
  5. <body>
  6. <?php
  7. $connection = @mysql_connect('localhost', 'uzytkownik', 'haslo')
  8.  
  9. or die('Brak połączenia z serwerem MySQL.<br />Błąd: '.mysql_error());
  10.  
  11. echo "Udało się połączyć z serwerem!<br />";
  12.  
  13. $db = @mysql_select_db('nazwa_bazy', $connection)
  14.  
  15. or die('Nie mogę połączyć się z bazą danych<br />Błąd: '.mysql_error());
  16.  
  17. echo "Udało się połączyć z bazą dancych!";
  18.  
  19. mysql_close($connection);
  20. ?>
  21. <?php
  22. $login = $_POST['login'];
  23. $haslo = $_POST['haslo'];
  24. if($login) || ($haslo))
  25. {
  26. <div id="panel">
  27. <form>
  28. <label for="username">Nazwa użytkownika:</label>
  29. <input type="text" id="username" name="username">
  30. <label for="password">Hasło:</label>
  31. <p><a href="#">Zapomniałeś hasła?</a></p>
  32. <input type="password" id="password" name="password">
  33. <div id="lower">
  34. <input type="checkbox"><label class="check" for="checkbox">Zapamiętaj mnie!</label>
  35. <input type="submit" value="Login">
  36. </div>
  37. </form>
  38. </div>
  39. }
  40. else
  41. {
  42. if($login == 'zsa' && $haslo == 'twoje_haslo')
  43. {
  44. echo 'zalogowany';
  45. }
  46. else
  47. {
  48. echo złe dane;
  49. }
  50. }
  51. ?>
  52. </body>
  53. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement