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!";