Currently I am using a tutorial about paginating with the regular page numbers.
How do I change this code to put the pages into a dropdown list?
$total_results = mysql_result(mysql_query("SELECT COUNT(*) as Num FROM log"),0); // Figure out the total number of results in DB:
$total_pages = ceil($total_results / $max_results); // Figure out the total number of pages. Always round up using ceil()
?>
<br><br><center><span class='FormValueBold'>Select a Page</span><br /> <? // Build Page Number Hyperlinks ?>
<?
// Build Previous Link
if($page > 1){
$prev = ($page - 1);
echo "<a href=\"".$_SERVER['PHP_SELF']."?page=$prev\"><<Previous</a> ";
}
for($i = 1; $i <= $total_pages; $i++){
if(($page) == $i){
echo "<span class='SmallHeader'>$i</span> ";
} else {
echo "<a href=\"".$_SERVER['PHP_SELF']."?page=$i\">$i</a> ";
}
}
// Build Next Link
if($page < $total_pages){
$next = ($page + 1);
echo "<a href=\"".$_SERVER['PHP_SELF']."?page=$next\">Next>></a>";
}
echo "</center>";
?>
Any help would be appreciated!
thanks!