Your IP : 216.73.216.74


Current Path : /home/www/khana.org.af/server/artical/
Upload File :
Current File : //home/www/khana.org.af/server/artical/read.php

<?php
require_once('../conn.php');
$query = "SELECT * FROM `artical`";


if (isset($_POST['id'])) {
  $query .= " where id=$_POST[id]";
}

if (isset($_POST['limit'])) {
  $query .= " LIMIT $_POST[limit]";
}


$select = $conn->prepare($query);
$select->execute();

$counter = 0;
$div = '';
$div1 = '';

while ($row = $select->fetch(PDO::FETCH_ASSOC)) {
  $counter++;

  $div .= '<div class="col-md-4">
              <div class="card m-1 d-flex p-2 pb-3" style="overflow:hidden;  height:450px">
              <h3 class="text-center card-title">' . $row['subjects'] . '</h3>
              <p class="text-justify">' . $row['body'] . ' ...</p>
              </div>
                
                 <a href="./details_artical.php?id=' . $row['id'] . '"> <span>Read More</span> <i class="bi bi-arrow-right"></i></a>   
              </div>
              ';

  $div1 .= '<div class="col-md-12">
              <div class="card m-1 d-flex p-2 pb-3">
              <a href="./details_artical.php?id=' . $row['id'] . '"><h3 class="text-center card-title" style="font-size:40px;">' . $row['subjects'] . '</h3></a>
              <hr>
              <p class="text-justify" style="text-align:justify; font-size:20px">' . substr($row['body'], 0, 1000)  . ' ...</p>
              </div>
              <hr>
                <a href="./assets/arti_file/' . $row['file'] . '" style="font-size:20px; color:white; background-color:#8B0000; border-radius:10px; padding:10px"> <span>PDF </span> <i class="bi bi-arrow-right"></i></a>
                  
              </div>';
}

if (isset($_POST['id'])) {
  echo $div1;
} else {

  echo $div;
}