This commit is contained in:
Patryk 2018-12-12 22:09:48 +01:00
parent 5bebf2ead6
commit 8978efd4dd

View File

@ -1,5 +1,19 @@
<?php if( !isset( $_SESSION ) ) session_start(); <?php
$user_id = $_SESSION['user_id']; include "../settings/db_connect.php";
$post = $_GET['post'];
if ($sql = $mysqli->prepare("SELECT blog_id FROM post WHERE post_id =$post"))
{
$sql->execute();
$sql->bind_result($id_blog);
while ($sql->fetch())
{
$blog_id=$id_blog;
}
}
$sql->close();
?> ?>
<html lang="pl-PL"> <html lang="pl-PL">
<head> <head>
@ -31,7 +45,7 @@ $user_id = $_SESSION['user_id'];
Menu Menu
</button> </button>
<div class="dropdown-menu" aria-labelledby="dropdownMenu2"> <div class="dropdown-menu" aria-labelledby="dropdownMenu2">
<li><a href="blog.php?user_id=<?php echo $user_id; ?>">Wróć do bloga</a></li> <li><a href="blog.php?user_id=<?php echo $blog_id; ?>">Wróć do bloga</a></li>
<li><a href="../index.html">Strona główna</a></li> <li><a href="../index.html">Strona główna</a></li>
</div> </div>
</div> </div>
@ -49,9 +63,7 @@ $user_id = $_SESSION['user_id'];
<?php <?php
include "../settings/db_connect.php";
$post = $_GET['post'];
$trash = ''; $trash = '';
if ($sql = $mysqli->prepare("SELECT * FROM post WHERE post_id =$post")) if ($sql = $mysqli->prepare("SELECT * FROM post WHERE post_id =$post"))
{ {