Advertisement
Guest User

Untitled

a guest
Oct 6th, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.07 KB | None | 0 0
  1. <?php
  2. session_start();
  3. require "mysql.php";
  4. if(isset($_POST['login1'])){
  5. $user=$_POST['login1'];
  6. $pass=sha1($_POST['haslo1']);
  7. $connect = mysqli_connect($mysql_server,$mysql_admin,$mysql_pass,$mysql_db);
  8. $uzytkownicy = mysqli_query($connect,'SELECT * FROM uzytkownicy WHERE nazwa_uzytk ="'.$user.'" and haslo="'.$pass.'"');
  9.  
  10. if($uzytkownicy){
  11. if($uzytkownicy->num_rows==1){
  12. header("Location:strona.php");
  13. $_SESSION['logowanie']=admin;
  14. }
  15. else{
  16. $_SESSION['zle']=zle;
  17. echo "Nieprawidłowe hasło lub login";
  18. }
  19. }
  20. else{
  21. echo "blad bazy danych";
  22. }
  23. }
  24. ?>
  25. <html>
  26. <head>
  27. <link rel="stylesheet" type="text/css" href="cos.css">
  28. <meta charset="utf-8">
  29. </head>
  30. <body>
  31. <?
  32.  
  33. ?>
  34.  
  35.  
  36. <form action="index.php" method="post" class="form">
  37. <div class="panel">
  38. <b><label for "password">Hasło :</label></b>
  39. <input type="password" name="haslo1" class="password" />
  40. <br> <b><label for "username">Login :</label></b>
  41. <input type="text" name="login1" class="username"/>
  42. <br>
  43. <input type="submit" value="wyslij" class="button">
  44. </div>
  45. </form>
  46.  
  47. </body>
  48. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement