From 0fc2b9a2a4e42b9c918cd55debc82f37dbbfefb9 Mon Sep 17 00:00:00 2001 From: s416267 Date: Sun, 16 Dec 2018 20:04:16 +0100 Subject: [PATCH] =?UTF-8?q?odsy=C5=82anie=20po=20logowaniu=20do=20posta?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- admin-zone/login.php | 12 +++++++++++- admin-zone/logincheck.php | 8 +++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/admin-zone/login.php b/admin-zone/login.php index 0edd9e9..2273706 100644 --- a/admin-zone/login.php +++ b/admin-zone/login.php @@ -1,4 +1,11 @@ - + Logowanie - Projekt blogowy @@ -48,6 +55,9 @@ +
+ Nie mam konta +
diff --git a/admin-zone/logincheck.php b/admin-zone/logincheck.php index d91cd36..9cf6629 100644 --- a/admin-zone/logincheck.php +++ b/admin-zone/logincheck.php @@ -12,10 +12,16 @@ if(isset($_POST['submitas'])){ $query = mysqli_query($mysqli, "SELECT * FROM user WHERE password='$password' AND username='$user'"); $rows = mysqli_num_rows($query); if($rows == 1){ - header("Location: index.php"); $_SESSION['user']=$user; $_SESSION['password']=$password; $_SESSION['loggedIn']=1; + if (isset($_SESSION['post'])) { + $post = $_SESSION['post']; + header("Location: ../blog-post/post.php?post=$post"); + } + else { + header("Location: index.php"); + } } else{ $error="Login lub hasło są nieprawidłowe!";