PK

ADDRLIN : C:/Inetpub/vhosts/dharmayatra.co.in/httpdocs/
FLL :
Current File : C:/Inetpub/vhosts/dharmayatra.co.in/httpdocs/blog-details.php

<?php
include './includes/header.php';
include './includes/db.php';

$id = $_GET['id'];

$query = "SELECT * FROM blogs WHERE id=$id";
$result = mysqli_query($conn, $query);
$blog = mysqli_fetch_assoc($result);
?>
<style>
    .blog-container {
        max-width: 900px;
        margin: auto;
        padding: 60px 20px;
    }

    .blog-header h1 {
        font-size: 36px;
        margin-bottom: 10px;
        line-height: 1.3;
    }

    .blog-meta {
        color: #777;
        font-size: 14px;
    }

    .blog-image {
        margin: 30px 0;
    }

    .blog-image img {
        width: 100%;
        border-radius: 12px;
        box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    }

    .blog-content {
        font-size: 18px;
        line-height: 1.8;
        color: #333;
    }

    .blog-content p {
        margin-bottom: 20px;
    }

    .back-btn {
        margin-top: 40px;
    }

    .back-btn a {
        text-decoration: none;
        color: #007bff;
        font-weight: bold;
    }

    .back-btn a:hover {
        text-decoration: underline;
    }
</style>
<div class="blog-container" style="background-color: white;">

    <!-- 🔥 BLOG HEADER -->
    <div class="blog-header">
        <h1><?= $blog['title'] ?></h1>
        <!-- <p class="blog-meta">
            📅 <? //= date("F d, Y", strtotime($blog['date'])) 
                ?>
        </p> -->
        <p class="blog-meta">
            📅
            <?php
            if (!empty($blog['date'])) {
                echo date("F d, Y", strtotime($blog['date']));
            } else {
                echo "Recently Published";
            }
            ?>
        </p>
    </div>

    <!-- 🖼 FEATURE IMAGE -->
    <div class="blog-image">
        <img src="uploads/<?= $blog['image'] ?>" alt="<?= $blog['title'] ?>">
    </div>

    <!-- 📄 CONTENT -->
    <div class="blog-content">
        <?= nl2br($blog['content']) ?>
    </div>

    <!-- 🔙 BACK BUTTON -->
    <div class="back-btn">
        <a href="blog.php">← Back to Blogs</a>
    </div>

</div>

<?php include './includes/footer.php'; ?>


PK 99