Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- include "global.php";
- if ( $_POST['login-submit'] )
- {
- $username = $_POST['username'];
- $password = $_POST['password'];
- $result = $mysqli->query("SELECT * FROM `Konta` WHERE `username`='".$username."' AND `password`=MD5('".$password."')");
- $row = $result->fetch_array();
- if ($mysqli->affected_rows>0){
- $konto = array(
- "ident" => $row['id'],
- "username" => $username,
- "email" => $row['email']
- );
- $_SESSION['konto'] = $konto;
- $message = "Zalogowano jako ".$username;
- }
- else $message = "Błędne dane logowania lub konto nie istnieje.";
- }
- ?>
- <!DOCTYPE html>
- <html lang="en">
- <head>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement