Im using a script to fetch results from mysql and then display a certain number per page...
This part is used to display the numbers of pages.. also linking to the pages...
PHP Code:
for($i = 1; $i <= $total_pages; $i++){
if(($page) == $i){
echo "$i ";
} else {
echo "<a href=\"".$_SERVER['PHP_SELF']."?page=$i\">$i</a> ";
}
}
So it displays 1 2 3 4 5 6 7 etc depending on the number of pages...
Theres also the <<Previous and Next >> links but thats a different part of the script..
The problem is when I have 170 pages of results it displays..
1 2 3 4 4 5 6 7...... all the way upto 170 which expands the screen width and makes it look a mess...
What I want it to look like is like on this forum when you view multiple pages...
So it only displays a few numbers like...
<< 55 56 57 58 59 >>
How would I do this??
Thanks
--James 
|