I'm trying pagination. It works fine, except the 'unhyperlinked' page numbers are 'unhyperlinked' one off.
To see what I mean click here.
I can't seem to fix it. Here is my code:
Thank you.
-CALV1N
To see what I mean click here.
I can't seem to fix it. Here is my code:
Code:
$result = mysql_query("SELECT * FROM test");
$total_entries = mysql_num_rows($result);
echo "<p><br>";
if(empty($page)){
$page = 1;
}
$limitvalue = $page * $maxentriestodisplayperpage - ($maxentriestodisplayperpage);
echo "<table class=\"main\" width=\"$tablewidth%\" border=\"0\"><tr><td></td><td align=\"right\">";
if($page != 1){
$pageprev = $page--;
echo("<a href=\"index.php?page=$pageprev\"></a> ");
}else
echo(" ");
$numofpages = $total_entries / $maxentriestodisplayperpage;
for($i = 1; $i <= $numofpages; $i++){
if($i == $page){
echo($i." ");
}else{
echo("<a href=\"index.php?page=$i\">$i</a> ");
}
}
if(($total_entries % $maxentriestodisplayperpage) != 0){
if($i == $page){
echo($i." ");
}else{
echo("<a href=\"index.php?page=$i\">$i</a> ");
}
}
if(($total_entries - ($maxentriestodisplayperpage * $page)) > 0){
$pagenext = $page++;
echo("<a href=\"index.php?page=$pagenext\"></a>");
}else{
echo("");
}
mysql_free_result($result);
Thank you.
-CALV1N