D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
home3
/
encodto1
/
www
/
Filename :
blog-details.php
back
Copy
<?php include 'database.php'; if (isset($_GET['id'])) { $blog_id = intval($_GET['id']); // Sanitize input to prevent SQL injection // Fetch the blog details from the database $query = "SELECT title, content, image FROM blogs WHERE id = $blog_id"; $result = mysqli_query($conn, $query); if ($result && mysqli_num_rows($result) > 0) { $blog = mysqli_fetch_assoc($result); $title = htmlspecialchars($blog['title']); $content = htmlspecialchars($blog['content']); $image = htmlspecialchars($blog['image']); } else { // Redirect or show an error if the blog is not found echo "<p>Blog not found.</p>"; exit; } } else { echo "<p>Invalid blog ID.</p>"; exit; } ?> <!DOCTYPE html> <html lang="en"> <?php include 'style.php'; ?> <body> <!-- Main --> <main class="main-page blog-details-page"> <!-- Header --> <?php include 'header.php'; ?> <!-- Blog Breadcrumb --> <section class="hero-service-wrap hero-section-wrap hero-blog-wrap"> <div class="hero-section-content-wrap"> <div class="custom-container"> <div class="hero-portfolio-body"> <div class="hero-section-content text-center"> <h5 class="section-subtitle">Blog Details</h5> <h1 class="section-title fade-in"><?php echo $title; ?></h1> <p>Stay connected with us by subscribing to our blog updates. By doing so, <br> you'll receive notifications whenever we publish new articles.</p> </div> </div> </div> </div> </section> <!-- Blog Content --> <section class="blog-details-area"> <div class="custom-container"> <div class="blog-details-body"> <div class="blog-details-inner"> <div class="blog-details-introduction"> <h1><?php echo $title; ?></h1> <img src="encoadminders/<?php echo $image; ?>"/> <p><?php echo html_entity_decode($content); ?></p> </div> </div> </div> </div> </section> <!-- Footer --> <?php include 'footer.php'; ?> </main> <!-- jQuery Frameworks ============================================= --> <script src="assets/js/jquery-3.7.0.min.js"></script> <script src="assets/js/bootstrap.bundle.min.js"></script> <script src="assets/js/gsap.min.js"></script> <script src="assets/js/Draggable.min.js"></script> <script src="assets/js/swiper-bundle.min.js"></script> <script src="assets/js/client-marquee.js"></script> <script src="assets/js/theme-custom.js"></script> <script src="assets/js/form1.js"></script> <script src="assets/js/subscribe-form.js"></script> </body> </html>