Coding Part
Coding Part
Index.php
<tr>
<tr>
include_once("categories.php"); ?></td>
<tr>
</tr>
$adjacents = 2;
$total_pages = mysql_fetch_array(mysql_query($query));
$total_pages = $total_pages[num];
/* Setup vars for query. */
$limit = 12;
/*echo $_GET['page'];
$page = $_GET['page'];
if($page)
on this page
else
$start = 0;
/* Get data. */
$prores = mysql_query($pro);
is given, default to 1.
$prev = $page - 1;
page is page + 1
$lastpage = ceil($total_pages/$limit); //lastpage is = total
page minus 1
/*
*/
$pagination = "";
if($lastpage > 1)
//previous button
if ($page > 1)
previous</a>";
else
previous</span>";
//pages
breaking it up
{
if ($counter == $page)
$pagination.= "<span
class=\"current\">$counter</span>";
else
$pagination.= "<a
href=\"$targetpage?page=$counter\">$counter</a>";
some
$counter++)
if ($counter == $page)
$pagination.= "<span
class=\"current\">$counter</span>";
else
$pagination.= "<a
href=\"$targetpage?page=$counter\">$counter</a>";
$pagination.= "...";
$pagination.= "<a
href=\"$targetpage?page=$lpm1\">$lpm1</a>";
$pagination.= "<a
href=\"$targetpage?page=$lastpage\">$lastpage</a>";
($adjacents * 2))
$pagination.= "<a
href=\"$targetpage?page=1\">1</a>";
$pagination.= "<a
href=\"$targetpage?page=2\">2</a>";
$pagination.= "...";
if ($counter == $page)
$pagination.= "<span
class=\"current\">$counter</span>";
else
$pagination.= "<a
href=\"$targetpage?page=$counter\">$counter</a>";
$pagination.= "...";
$pagination.= "<a
href=\"$targetpage?page=$lpm1\">$lpm1</a>";
$pagination.= "<a
href=\"$targetpage?page=$lastpage\">$lastpage</a>";
else
$pagination.= "<a
href=\"$targetpage?page=1\">1</a>";
$pagination.= "<a
href=\"$targetpage?page=2\">2</a>";
$pagination.= "...";
if ($counter == $page)
$pagination.= "<span
class=\"current\">$counter</span>";
else
$pagination.= "<a
href=\"$targetpage?page=$counter\">$counter</a>";
//next button
»</a>";
else
$pagination.= "</div>\n";
} if($total_pages<=0)
{ ?>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
<?php } else {
$cnt=0;
while($prorow=mysql_fetch_array($prores)) {
$cnt++;
if($cnt%1==1)
echo "<tr>";
if($cnt%3==1)
{
echo "</tr><tr><td align=\"right\" colspan=\"3\"> </td></tr><tr>";
?>
</form>
<tr>
<tr>
</tr>
<tr>
</tr>
<tr>
class="text_2" colspan="2"> </td>
</tr>
<tr>
/></a></td>
</tr>
<tr>
value="1" />
</td>
</tr>
</table></td>
</tr>
</table></td>
<?php } }?>
<tr>
</tr>
<tr>
</table></td>
include_once("rightside.php"); ?>
<p> </p>
<p> </p>
</form></td>
</tr>
</table></td>
</tr>
Header.php
<?php session_start();
ob_start();
include_once("dbconnect.php");
?>
Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-
transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-
1" />
<style type="text/css">
<!--
body,td,th {
font-size: 12px;
color: #333333;
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
-->
</style>
<script>
function searchvalid()
var d=document.king;
if(d.keyword.value=="")
return false;
return true;
</script>
</head>
<body>
cellspacing=" 0">
<tr>
<tr>
<tr>
height="100" /></td>
0">
<tr>
<td width="19%" rowspan="2" align="center"
height="11" /></td>
</tr>
<tr>
</tr>
</table></td>
</tr>
<tr>
left:20px;"><strong>Search :</strong>
$_GET['keyword'];?>" /></td>
</form>
</tr>
</table></td>
</tr>
<?php } ?>
</td>
</tr>
</table>
</tr>
<tr>
<tr>
<tr>
background="images/flash_td_top_spacer.gif"> </td>
</tr>
<tr>
background="images/flash_td_left_spacer.gif"> </td>
background="images/flash_td_right_spacer.gif"> </td>
</tr>
<tr>
background="images/flash_td_bottom_spacer.gif"></td>
</tr>
</table></td>
<tr>
</tr>
<tr>
</tr>
<tr>
</tr>
</table></td>
</tr>
</table></td>
</tr>