<?php
include ("config.php");
$stranici = 10;
$pageNum = 1;
if(isset($_GET['page'])) {
$pageNum = $_GET['page']; }
$reds = ($pageNum - 1) * $stranici;
$query = " SELECT * FROM news ORDER BY id DESC" . " LIMIT $reds, $stranici";
$result = mysql_query($query);
while ($sql = mysql_fetch_object($result)) {
$title = $sql -> title;
$novinata = $sql -> novinata;
$date = $sql -> date;
$id = $sql -> id;
$title="$title";
$title=substr($title,0 , 40);
echo "<div id='content'><div class='article'>
<h2><span><a href='view.php?id=$id'>$title</a></span></h2>";
echo "<p class='info noprint'><span class='date'>$date</span> <span class='comments'>113</span></p>";
$novinata = "$novinata";
$novinata = substr($novinata,0 , 250);
echo $novinata." <p class='btn-more box noprint'><strong><a href='view.php?id=$id'>Още..</a></strong></p>";
echo "</div><hr class='noscreen' /></div>";}
?>