TAS-ALFA/blog-post/post.php
2018-12-01 22:54:48 +01:00

122 lines
3.4 KiB
PHP

<html lang="pl-PL">
<head>
<meta charset="utf-8">
<title>Bloggero</title>
<link rel="Shortcut icon" href="img/name-label.png" />
<meta content="width=device-width, initial-scale=1.0" name="viewport">
<meta content="" name="keywords">
<meta content="" name="description">
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js" integrity="sha384-ZMP7rVo3mIykV+2+9J3UJ46jBk0WLaUAdn689aCwoqbBJiSnjAK/l8WvCWPIPm49" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js" integrity="sha384-ChfqqxuZUCnJSK3+MXmPNIyE6ZbWh2IMqE241rYiqJxyMiZ6OW/JmZQ5stwEULTy" crossorigin="anonymous"></script>
<link href="https://fonts.googleapis.com/css?family=Oswald:400,300,700|Lato:400,700" rel="stylesheet">
<link href="lib/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link href="css/style.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<!-- ikony -->
</head>
<body>
<div class="dropdown">
<div id="menuwrap">
<button class="btn btn-light dropdown-toggle btn-lg" type="button" id="dropdownMenu2" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Menu
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenu2">
<li><a href="blog.php #about">O mnie</a></li>
<li><a href="blog.php #post">Posty</a></a></li>
<li class="divider"></li>
<li><a href="../blogcenter/index.html">Strona główa</a></li>
</div>
</div>
</div>
<div id="aboutdown">
<section id="about" name="about"></section>
<div id="aboutwrap">
<div class="container">
<div class="row">
<?php
include "../settings/db_connect.php";
$trash = '';
if ($sql = $mysqli->prepare("SELECT * FROM post WHERE post_id = 18"))
{
$sql->execute();
$sql->bind_result($post_id,$trash,$title,$description,$main,$image,$date,$mod_date);
while ($sql->fetch())
{
echo "
<div class=\"col-lg-12 name foto2 cover foto1\">
<img class=\"align-text-bottom\" src=\"$image\" alt=\"\">
<h1> $title</h1>
</div>
<div class=\"col-lg-12 name-desc\">
<h3>$description</h3>
</div>
<div class=\"col-lg-12 name-desc\">
<post>$main</post>
<h4>$date</h4>
</div>
";
}
$sql->close();
}
else die( "Błąd w zapytaniu SQL! Sprawdź kod SQL w PhpMyAdmin." );
if ($sql = $mysqli->prepare("SELECT * FROM comments ORDER BY comment_id"))
{
$sql->execute();
$sql->bind_result($comment_id,$post_id,$username,$tekst,$data_dodania, $data_modyfikacji);
echo " <div class=\"name\"> <h1> Komentarze</h1> </div> ";
while ($sql->fetch())
{
echo "
<div class=\"col-lg-12 col-md-12 col-sm-12 col-xs-12 name-desc\">
<a href=\"blog.php\"><po> $username</po></a>
<h6>$tekst </h6>
<h5>$data_modyfikacji</h5>
</div>";
}
$sql->close();
}
else die( "Błąd w zapytaniu SQL! Sprawdź kod SQL w PhpMyAdmin." );
echo " <div class=\"name\"> <h2> Dodaj komentarz:</h2> </div> ";
$mysqli->close();
?>
</body>
</html>