Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>PHP&MySQL - View post | Zadaca 3</title>
- <link rel="stylesheet" type="text/css" href="css/style.css">
- </head>
- <body>
- <nav>
- <div class="logout">
- <a href="logout.php">Logout</a>
- </div>
- </nav>
- <div class="container">
- <?php
- session_start();
- include ('include/connection.inc.php');
- $id = $_GET['id'];
- $sql = "SELECT * FROM 'posts' WHERE id=$id";
- $result = mysqli_query($conn, $sql);
- while($row = mysqli_fetch_assoc($result))
- {
- //echo '<h1></h1>';
- echo '<h1>'.$row['title'].'</h1>';
- echo '<br>';
- echo '<img class="header-img" src="images/'.$row['image'].'">';
- echo '<br>';
- echo '<p><b>Published: </b>'.$row['date_created'].'</p>';
- echo '<p>'.$row['content'].'</p>';
- }
- ?>
- <p>Back to <a href="dashboard.php">Dashboard</a></p>
- </div>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement