rendered paste body<body bgcolor="#555555" background="images/newsbg.gif">
<table cellpadding="0" cellspacing="0" width="100%"><tr>
<td background="images/newsspan.gif" valign="top" width="100%"><center><img src="images/heads/newshead.gif"></center></td>
<td background="images/belownavbg.gif" valign="top" width="100%"></td>
</tr></table>
<table cellpadding="10" cellspacing="0" width="100%" height="100%"><tr height="100%">
<td bgcolor="#444444" valign="top" height="100%" background="images/newsbg.gif">
<?php
require 'news/connect.php';
if(isset($_GET['page'])) {
$page = (int) $_GET['page']; // this makes sure the page is a number, to save you from SQL injection
$limit = ' LIMIT '. ($page -1) * 3 .' , 3 ';
}
else {
$limit = " LIMIT 3";
}
$query = "SELECT title, news, admin, date FROM news ORDER BY id DESC $limit ";
$result = mysql_query($query);
$r = 2;
while($r=mysql_fetch_array($result))
{
$title=$r["title"];
$news=$r["news"];
$admin=$r["admin"];
$date=$r["date"];
echo "<b> $title <br></b>Posted on: $date, by: $admin <blockquote>$news</blockquote>";
}
$result = mysql_query("SELECT COUNT(*) FROM news");
$num_of_pages = mysql_result($result, 0);
for($i=1;($i-1)*3<$num_of_pages;$i++) {
echo '<center><a href="http://www.soroun.com/v2/index.php?page=' . $i . '">' . $i . '</a></center>';
}
?>
</td></tr></table>
</body>