File: /home/wekawqug/ndondocup.sisihub.co.tz/read_news.php
<?php
session_start();
include 'admin/db_connect.php' ;
// Update the view count in the database
$conn->query("UPDATE post_list P SET views = views + 1 WHERE md5(p.id) = '{$_GET['c']}'");
$qry = $conn->query("SELECT p.*,c.category FROM post_list p inner join category_list c on c.id = p.category_id where md5(p.id) = '{$_GET['c']}'")->fetch_array();
foreach($qry as $k =>$v){
$$k = $v;
}
?>
<section class="single-post-content" style="margin-top:100px">
<div class="container">
<div class="row">
<div class="col-md-9 post-content">
<!-- ======= Single Post Content ======= -->
<div class="single-post">
<div class="post-meta"><span class="date"><?php echo ucwords($category) ?></span> <span class="mx-1">•</span> <span><?php echo date("F d,Y", strtotime($date_published)) ?></span></div>
<h1 class="mb-5"><?php echo ucwords($title) ?></h1>
<p><span class="firstcharacter"></span></p>
<figure class="my-4" style ="display:flex;justify-content: center; align-items: center;flex-direction: column;">
<img src="assets/uploads/content_images/<?php echo $cover_img ?>" alt="" class="img-fluid" style="width:620px; align:center;">
<figcaption> </figcaption>
</figure>
<?php echo html_entity_decode($content) ?>
</div><!-- End Single Post Content -->
</div>
<div class="col-md-3">
<?php include 'sidebar.php' ?>
</div>
</div>
</div>
</section>