Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- session_start();
- require "mysql.php";
- if(isset($_POST['login1'])){
- $user=$_POST['login1'];
- $pass=sha1($_POST['haslo1']);
- $connect = mysqli_connect($mysql_server,$mysql_admin,$mysql_pass,$mysql_db);
- $uzytkownicy = mysqli_query($connect,'SELECT * FROM uzytkownicy WHERE nazwa_uzytk ="'.$user.'" and haslo="'.$pass.'"');
- if($uzytkownicy){
- if($uzytkownicy->num_rows==1){
- header("Location:strona.php");
- $_SESSION['logowanie']=admin;
- }
- else{
- $_SESSION['zle']=zle;
- echo "Nieprawidłowe hasło lub login";
- }
- }
- else{
- echo "blad bazy danych";
- }
- }
- ?>
- <html>
- <head>
- <link rel="stylesheet" type="text/css" href="cos.css">
- <meta charset="utf-8">
- </head>
- <body>
- <?
- ?>
- <form action="index.php" method="post" class="form">
- <div class="panel">
- <b><label for "password">Hasło :</label></b>
- <input type="password" name="haslo1" class="password" />
- <br> <b><label for "username">Login :</label></b>
- <input type="text" name="login1" class="username"/>
- <br>
- <input type="submit" value="wyslij" class="button">
- </div>
- </form>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement