Hey Guys,.. If there is guru that has a few mins spare I would be grateful for some help.. I have an admin panel that has page numbers on the footer, but need these to be a little smarter as people are starting to really use my site now.. here is the snippet of code that needs fixing.. echo "</table>"; echo "<table width='100%'>"; echo "<tr>"; echo "<td>THERE ARE $num_of_users USERS</td>"; echo "<td>"; if ($_GET['page'] == 0){ } else { echo "<a href='-1212/admin.php?page=$prevpage'>PREV</a>"; } for ($i = 0; $i < $pages; $i++){ echo "<a href='-1212/admin.php?page=$i'> $i </a>"; } if (($_GET['page']) == $pages){ } else { echo "<a href='-1212/admin.php?page=$nextpage'>NEXT</a>"; } echo "</td>"; echo "</tr>"; echo "</table>"; Which shows: USERS Previous 1 2 3 4 5 6 7 8 9 10 11 12 13 14 All the way over here... And here... Next But I have over 90 pages now and things are starting to get a little crazy on that footer.. Any suggestions? Something like, maybe it shows blocks of 10 or 20?? Like they do on here at the bottom right of the topic page here. Like I said above, if someone has a few mins spare, I would be very grateful for the help.. Much Apreciated Lee
You s hould break the loop when it reaches to particular figure say 40 or 50 you can use break statement to come out of the loop using if statement
You can add two simple if statements within your for loop and limit printing out those numbers to a certain range.